Auto Number PowerApp Custom Control

I developed my first PowerApp custom control which will generate Auto Number based on the format that you specified. I find this always a missing functionality from MS to generate Auto Number based on the data in a record. I thought it would be useful tool for lot of customers. The following are some details about my control.

  1. You need to specify the AutoNumber format in the following format
  2. Use {Something} if you want include constant string in the Auto Number like Prefix or Suffix. For ex: {ACC}
  3. Use [fieldname] if you want to include a field value in the Auto Number. For ex: [accountnumber]
  4. Use [fieldname(fieldname)] if you want to include a field value from the look up field. For ex: [transactioncurrencyid(isocurrencycode)]
  5. You can use any separator in between.
  6. For ex if you provide in this format {ACC}-[accountnumber]-[parentaccountid(numberofemployees)] , the output would be ACC-1001-200 (based on the values of the particular record).


You can find the source code here

PCF Gallery link here

Microsoft Dynamics 365 for Outlook is unable to render entity views (web pages)

After installing the August 2018 Office update, we are struggling with the error message “Waiting for a page to be retrieved from a Microsoft Dynamics 365 server…” when using Microsoft Dynamics 365 for outlook app.

Solution

As a workaround while this issue is under investigation, navigate to the following location within Outlook:

File -> Options -> General -> User Interface Options -> When using multiple displays

Change the value of this setting to “Optimize for compatibility” (it will also notify you an application restart is required).

Outlook Multi-monitor optimization

Once Outlook is restarted, the webpages within the Microsoft Dynamics 365 for Outlook will be able to render webpages again. 

This can also be enforced through GPO via the following registry location (ensure to restart Outlook if running while this is set):

[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\16.0\Outlook] “ForceLegacyDpiAwarenessMode”=dword:00000001 

View Designer plugin in XrmToolBox

In one of my previous post I explained how to apply “OR” condition for the filters that are split between the two entities, however, these type of conditions were not possible to apply for views in MS CRM. But, now we have a new plugin called “ViewDesigner” introduced in our favorite XrmToolBox where you can apply whatever filter you want to the existing views in CRM.  Here is the link to know full advantages and usage of this plugin.

https://stoneridgesoftware.com/going-beyond-advanced-find-views-and-xrmtoolbox-view-designer-fetchxml-builder/

Hope it makes easier the developer effort !!!

Restrict contact deletion on account delete

As per the OOB functionality all the child records of account like contacts, opportunities and activities etc., will be deleted on delete of account. But, in one of my project we got a requirement to remove the link with contacts instead of delete. I tried to customize the relationship but the CRM is not allowing us to do this.

2018-11-05_1514

Finally we ended up with writing the plugin to achieve this. We have to write this plugin on “Pre Validation” stage of “Delete” step on Account entity. The child records were not available in any other steps (Pre Operation for ex) as the CRM platform deletes all the child records first and then account. The following is the plugin code.


IPluginExecutionContext pluginContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService organizationService = serviceFactory.CreateOrganizationService(pluginContext.UserId);
EntityReference targetEntity = (EntityReference)pluginContext.InputParameters["Target"];

QueryExpression getContacts = new QueryExpression("contact");
getContacts.Criteria.AddCondition(new ConditionExpression("parentcustomerid", ConditionOperator.Equal, targetEntity.Id));
EntityCollection allContacts = organizationService.RetrieveMultiple(getContacts);
foreach(Entity contact in allContacts.Entities)
{
Entity contactToBeUpdated = new Entity("contact");
contactToBeUpdated.Id = contact.Id;
contactToBeUpdated.Attributes["parentcustomerid"] = null;
organizationService.Update(contactToBeUpdated);
}

Happy coding !!!

Use visual controls + calculated fields to create an in-form dashboard

Want to add some sizzle to you form configuration? Phil Dudovicz recommends using visual controls with calculated fields to create a nice looking dashboard in your Dynamics 365 Unified Interface form. The following is an example of an investor form that visually displays relevant investor data.

Let’s take a closer look at how this is built:

  1. Current Year return

  • Calculated Field
  • Data Type: Decimal Number
  • Field Type: Calculated
  • ((new_investmentvalue – new_investmentvaluejan1) / new_investmentvalue) * 100
  • Control: Arc Knob
  • Value: hsl_currentyearreturn
  • Min: .1
  • Max: 15
  • Step: .1

2. Return vs. Goal

  • Data Type: Decimal Number
  • Field Type: Calculated
  • (new_investmentvalue / new_investmentgoal) * 100
  • Control: Arc Knob
  • Value: hsl_goalprogress
  • Min: 0
  • Max: 100
  • Step: 1

By combining visual controls with calculated fields you can easily add visual context to a record and give your users a richer user experience.

Or condition between linked entities or multiple entites in MSCRM Fetchxml

We got a requirement to create view on Accounts which I own or which I am following. In this scenario we may not able to apply “OR” condition for the filters as the filters are split between the two entities (Account and Follows). We can achieve this using the below fetchxml but we can’t build this through Advanced Find. So either we can create a View through code or provide a report with the below fetchxml.

2018-10-25_1107

 

Hope it helps.