Tuesday, 28 August 2018

{Know-how} D365 BPF - Business process flow Disable a field or make attribute readonly



Requirements are always crazy, suppose if you want to optionally disable or enable a field in BPF it is possible with XRM object model. The only change is the prefix which you need to add to your attribute's logical name

Xrm.Page.getControl("header_process_<field logical name>").setDisabled(bool);

Friday, 27 July 2018

D365 - The attribute with AttributeId = 'Guid' was not found in the MetadataCache - MSCRM Solution Export


Error Message during solution export:
The attribute with AttributeId = <GUID> was not found in the MetadataCache.


Root Cause:
A field is deleted from CRM and the field is removed. But the related solution component reference is left behind somehow.


Fix:
Find the component related to the field and remove it.

Note: Make sure to have a back-up of DB or the Org before performing below operations. Need developer level knowledge to perform this!

Step 1: Find the missing component. Get the solutioncomponentid and componenttype by executing the following fetchxml  query after replacing the guid with the attributeid from the error message.

Note: You can XRM toolbox or C# console app to retrieve the record

<fetch top="50" >
  <entity name="solutioncomponent" >
    <all-attributes/>
    <filter type="and" >
      <condition attribute="objectid" operator="eq" value="<GUID>" />
    </filter>
  </entity>
</fetch>

Step 2: Get the "solutioncomponentid" and "componenttype"  from the result of above fetchxml query and use "RemoveSolutionComponentRequest" to remove the component.



var removeComponentReq = new RemoveSolutionComponentRequest()
{
    ComponentId = <GUID - solutioncomponentid>,
    ComponentType = <int - componenttype>,
    SolutionUniqueName = <string - solution's uniquename>
};

Hope this helps!

Thursday, 19 July 2018

{Know-how} D365 BPF - Business process flow Hide a field or Attribute using JS



Requirements are always crazy, suppose if you want to optionally hide and show a field in BPF it is possible with XRM object model. The only change is the prefix which you need to add to your attributes logical name

Xrm.Page.getControl("header_process_<field logical name>").setVisible(false);

{Know-how} D365 Advanced Find - Query users based on team - Createdby/owner/modifiedby Team




In dynamics community forum, I came across an interesting querying scenario using advanced find, the requirement is to query all leads created by a team. As we all know, all records in CRM are created by user and user is a team member in a team . Lets see how to query the same using advanced find


Advanced find => select leads in look for =>In query builder select field/related => select related "Created By(User)" => under "Created By (user)" select related "Teams" => Under "Teams" select field "Team" => select the team as your value with operator "Equals"


Hope this helps!

Tuesday, 17 July 2018

{Know-how}MSCRM Ribbon - No rows could be found for LocalizedLabel with id if LocalizedLabel were published


Lets have look into a issue I recently faced and fix for the same. Also will include other references that can help to solve root cause.

Issue:
Error while publishing a ribbon customization at localizedlabel.
No rows could be found for LocalizedLabel with id 10000000-0000-0000-0000-000000000001 if LocalizedLabel were published

Fix:

  • Include only the entities that requires ribbon customization
  • Remove the attributes - This causes localized label issue for most part
  • Remove all other components in entity which are not needed

Root Cause:

The issue seems to be with a corrupted localized label and when the attribute is included, CRM tries to publish the localized label and it breaks. 

In the below forum they suggest to remove the same using direct SQL, I would suggest to raise a ticket with MS in case if you face this issue.

Contact Form

Name

Email *

Message *