How to – Set Default value for the combo box in Canvas Apps (Dataverse)


Suppose we have the following Combo Box named Status bind to one of the choice fields of Dataverse.

Items = Asset Status option set field of table Product.

Now if we want Available to be the default selected value for it, we can use the DefaultSelectedItems property of the combo box.

DefaultSelectedItems = Filter(Choices(Products[@’Asset Status’]), Value = ‘Asset Status’.Available)

Also if we want to set the value of the Villages combo box based on the value selected in the Region combo box. The region is a lookup field in the Villages table.

We can update the Items property of the Villages combo box from

Villages (Data Source)

to

If(IsBlank(comboRegion.Selected),Villages, Filter(Villages, Region.Region = comboRegion.Selected.Region))

Hope it helps..

Advertisements

Calculated Column inside Plugin? – Dataverse / Dynamics 365


Recently while working on a plugin, we realized that for a particular column, we were not getting value in the context (on Post Create), the same was the case for Post Update and Post Image.

Also using Retrieve and RetrieveMultipleto fetch its value inside the Plugin didn’t work

Eventually, we realized it was a calculated column, which doesn’t give value inside the Plugin.

If we do RetrieveMultiple and RetrieveMultiple from a console app, outside Plugin, we get the value for that field.

Hope it helps..

 

Advertisements

Unable to install the Profiler. Unhandled Exception: System.InvalidCastException: Unable to cast object of type ‘Microsoft.Xrm.Sdk.Entity’ to type ‘CrmSdk.PluginType’ in Dynamics 365 / Dataverse


We might get the below error while trying to install the profiler in the Plugin Registration Tool.

“Unable to Install the profiler”

“Unhandled Exception: System.InvalidCastException: Unable to cast object of type ‘Microsoft.Xrm.Sdk.Entity’ to type ‘CrmSdk.PluginType’. at Microsoft.Crm.Tools.Libraries.OrganizationHelper.InstallProfiler(CrmOrganization org, String prtPath) at Microsoft.Crm.Tools.PluginRegistration.OrganizationControlViewModel.<>c__DisplayClass302_0.<InstallProfiler_Clicked>b__2(Object o, DoWorkEventArgs e)”

On closing the window we will get the below message “Profiler install failed”

Well we can ignore this error, just click on Refresh

After the refresh is completed,

we can see that the profiler has got installed successfully, even though we got the error.

Hope it helps..

 

Advertisements

Plugin registration profile record not getting created – Dataverse / Dynamics 365


Recently while trying to debug a plugin with Persist to Entity mode on the update step, we didn’t find any profile record getting created.

One option is to try to reinstall the profiler. This could happen when we are using a different version of the plugin registration tool and it has the Profiler already installed/configured from the other version of the tool.

If that doesn’t help, then opt for Exception mode, that has always worked.

Hope it helps..

Advertisements

Use Command checker (ribbondebug=true) to identify the Ribbon Customizations Issue – Dataverse / Dynamics 365


Appending ribbondebug=true to the record’s URL adds the new Command checker button in the command bar, which could help us in troubleshooting any unexpected behavior with ribbon.

More on this – https://powerapps.microsoft.com/en-us/blog/introducing-command-checker-for-model-app-ribbons/

Recently we added one enable rule to an existing button (Go Live) in the Customer Journey table. The rule was calling a JavaScript web resource based on the security role assigned to the user hiding or showing the button on the form.

Click on the Command checker to open the window on the side pane, where we can then select our button.

In the command properties tab, we can see our custom enable rule showing an error.

Also here clicking in View rule definition solution layers provides us the detail that this rule has been added as part of an unmanaged layer.

Clicking on the Unmanaged layer further provides us with the definition of the enable rule.

Going back to the error, we figured out that the function was missing from the web resource, and adding the function fixed the issue for us.

Back in the Command checker, we can see the custom Enable Rule getting evaluated correctly.

Check the Troubleshooting Guide

Hope it helps..

Advertisements

Contact’s Originating Lead – originatingleadid is not valid for update – Dynamics 365 / Dataverse


Recently we were writing a plugin that on the creation of a lead updates the originating lead of a contact record. The value was neither getting updated nor we were getting any errors.It was after we spent a good amount of time debugging, realized that this field cannot be updated.So basically, we can specify a value for it during create of contact but cannot update it.

Hope it helps..

Advertisements