How to find Business Rule, Form, View, Chart, Process and Message associated with a field

Sometimes we need to know which Form, View or Chart are using a field. Similarly we may need to check which Process and Plugin message are attached to a field. All these details can be viewed easily from field’s “Show Dependencies” functionality.

Generally navigation for “Show Dependencies” will be:
(Settings > Customizations > Customize the System > Components > Entites > Entity (Select your entity)  > Field (select your field) > Show Dependencies).

This window shows useful details about some other dependent components as well like Field, Entity Relationship, Email Template, Report etc. Business Rule is exception though, to see business rules we will need to click “Business Rules” button in same window.

Hope this tip will be helpful if you were not using it.

Please like/ follow my blog for more useful posts. Please feel free to leave a message, suggestion or question if I can help.

Enjoy 🙂

 

Advertisements

#entity-customization, #field-customization, #field-dependencies

Upgrading To Dynamics 365 ?

At Sydney CRM Saturday Greg Olsen (Dynamics 365 MVP from New Zealand) presented “What You Need To Know To Upgrade To Dynamics 365”. It was a very nice and much valuable talk. Speaker not only shared his experience but also packs of chocolates and sweets 🙂

Upgrades

It has helped me understanding planning

phase of upgrade. Luckily Greg has shared presentation and I m sharing link in this post below:

https://app.box.com/v/UpgradeToD365

Please like/ follow my blog if you found this post helpful. Feel free to leave a message, suggestion or question.

Have a very lovely weekend.

Cheers 🙂

How to view plugins deployment summary ?

Sometimes we need to know when last time a plugin was updated. This information is helpful usually before exporting assemblies from one environment to other.
In similar way few times we may need to know who updated a particular assembly last time ?

The following LINQ or Fetch Xml query will return this summary:

(from p in PluginAssemblySet
orderby p.ModifiedOn descending
select new
{
PluginName = p.Name, ModifiedOn = p.ModifiedOn.Value.ToLocalTime(),
ModifiedBy= p.ModifiedBy.Name, Role=p.ModifiedBy.LogicalName,Version=p.Version
}).Dump();

 

 

Citizen Integrator – Microsoft Flow and Dynamics 365

Yesterday at Melbourne Microsoft Dynamics 365 User Group meeting Bill Chesnut (Azure MVP) delivered a much valuable talk “Citizen Integrator – Microsoft Flow and Dynamics 365”.

From some basic to latest updates around Flow were covered. Luckily Bill has shared his talk and slides. There is slight buzz in background but it is still good.

Video:  http://www.sixpivot.com/sixpivotblog/

Slides: https://www.biztalkbill.com/wp-content/plugins/download-attachments/includes/download.php?id=9552

 

Enjoy

ConditionExpression error “expected argument(s) of type ‘System.Guid’ but received ‘System.Guid[]”

Today while writing query expression I was getting error:

Condition for attribute ‘sf_contract.contractid’: expected argument(s) of type ‘System.Guid’ but received ‘System.Guid[]’.

We can pass a single or multiple values in ConditionExpression using appropriate comparison operator(s). In this example ConditionExpression was comparing multiple GUID values (stored in object array) with an attribute using “IN” comparison operator.

ConditionExpression have a few constructors, and I was trying to use one that accepts params object[] as argument but it didn’t work as per expectation.

This error was gone when I changed my collection to attribute’s base type, so basically I changed object[] to Guid[]. Hope this explanation will save someone’s time.

QueryExpression error, “The formatter threw an exception while trying to deserialize the message”

Today I wrote a QueryExpression which was throwing exception “The formatter threw an exception while trying to deserialize the message”.

The complete error message was:

“The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:query. The InnerException message was ‘Error in line 1 position 2016. Element ‘http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType’ contains data from a type that maps to the name ‘http://schemas.microsoft.com/xrm/2011/Contracts:EntityReference’. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name ‘EntityReference’ and namespace ‘http://schemas.microsoft.com/xrm/2011/Contracts’.’. Please see InnerException for more details.”

I was using ‘EntityReference’ in a condition, and error message gives hint that somehow there is an issue with ‘EntityReference’ format, and it is not being deserialized correctly. To use ‘EntityReference’ in condition we need to pass its ‘GUID’, and not complete ‘EntityReference’ object.

In the following QueryExpression, the condition will produce a similar exception which can be avoided by passing GUID instead of passing ‘EntityReference’ object as parameter.

QueryExpression query = new QueryExpression();
query.EntityName = “new_document”;
query.ColumnSet = new ColumnSet(“new_name”);
query.Criteria.AddCondition(“new_authorid”, ConditionOperator.Equal,currentDoc.GetAttributeValue<EntityReference>(“new_authorid”));
EntityCollection results =org.RetrieveMultiple(query);

#dynamics-crm, #queryexpression, #sdk, #the-formatter-threw-an-exception-while-trying-to-deserialize-the-message

The ‘orderBy’ expression is limited to invoking the ‘ ‘ parameter

LINQ is widely used in projects and it makes querying very handy. Using LINQ for querying CRM data has some limitations though, some of the standard LINQ features are not supported to use with CRM.

One such limitation is when we are joining entities and also sorting results. To use orderby, we are limited to the first entity only (the left side entity in join). So the query in Example 1 works perfectly fine:

Example 1:

var results = from c in ContactSet
join a in AccountSet
on c.ContactId equals a.PrimaryContactId.Id
orderby c.FullName
select new
{
c.FullName,
c.Address1_City,
a.Name,
a.Address1_Name
};

But trying to sort by columns of other entity is not supported. So if we try Example 2 it will throw the following NotSupportedException

The ‘orderBy’ expression is limited to invoking the ‘c’ parameter.

Exaple 2:

var results = from c in ContactSet
join a in AccountSet
on c.ContactId equals a.PrimaryContactId.Id
orderby a.Name
select new
{
c.FullName,
c.Address1_City,
a.Name,
a.Address1_Name
};

Of course if you run similar quires directly on SQL Server database they will work fine.

Solution:

If you are getting this exception there are two possible solutions:

  • Modify your quey as per Example 1 and put orderby columns’s entity firs or on the left side of join
  • For queries involving orderby from multiple entities, select data, store it in memory and use a separate LINQ query to sort it.
    This MSDN document list limitations of LINQ for CRM

Enjoy working with CRM 🙂