Today we got a requirement to export the SSRS report to server daily in the morning with out asking any prompt. Initially I thought of writing a console app to export the SSRS as PDF and schedule that console app. But after some research I found a concept called “Subscriptions for native mode report server”, with this feature you can deliver the report through e-mail or to a shared folder as per the schedule defined. Refer this link for complete details like Create, Modify and Delete Subscription. Below is the screenshot of subscription that I created for my report.
Today we got a requirement to fetch all the records that are created in the last month by using MS Flow. We can do this by using “Dynamics 365 List records” action and we have to provide OData filter query for this action. I tried to use the same “last-month” operator that we use in the fetch xml. But this will not work for OData query. We need to use “LastMonth” function for this as defined in this link. The below are the examples to use these date functions.
Today we got a requirement to perform some logic on the create of case by using “Convert To Case” button on email activity. The logic shouldn’t execute if the case is created manually (Service –> Case –> +New). I decided to write a plugin on create of case and perform my logic but the problem is to identify whether the case is created manually or using “Convert To Case” button. Case record is not holding any reference of source email to distinguish. After some research I decided to write a plugin on “Update” of “Email” entity (filtering attribute: regardingobjectid). Whenever an email is converted to case, the platform updating the regarding field with the case that is newly created. So I felt this way I can identify the case which is created by using “Convert To Case” button. However, my plugin executes whenever some one update the regarding field manually on email entity, so I used the following conditions in my plugin to avoid this scenario.
Depth should be more than 1
Regarding shouldn’t hold any value in PreImage and should hold the value in PostImage
“Subject” of email should be same as the “Title” of the case
IOrganizationService organizationService = localContext.OrganizationService;
ITracingService tracingService = localContext.TracingService;
IPluginExecutionContext context = localContext.PluginExecutionContext;
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
Entity targetEntity = (Entity)context.InputParameters["Target"];
var targetRegardingObject = targetEntity.Contains("regardingobjectid") ? targetEntity.GetAttributeValue<EntityReference>("regardingobjectid") : null;
if (targetRegardingObject != null && targetRegardingObject.LogicalName == "incident")
Entity preImage = (Entity)context.PreEntityImages["PreImage"];
Entity postImage = (Entity)context.PostEntityImages["PostImage"];
var preRegarding = preImage.Contains("regardingobjectid") ? preImage.GetAttributeValue<EntityReference>("regardingobjectid") : null;
var postRegarding = postImage.Contains("regardingobjectid") ? postImage.GetAttributeValue<EntityReference>("regardingobjectid") : null;
var postSubject = postImage.Contains("subject") ? postImage.GetAttributeValue<string>("subject") : string.Empty;
var incidentRecord = organizationService.Retrieve("incident", targetRegardingObject.Id, new ColumnSet("title"));
var caseTitle = incidentRecord != null && incidentRecord.Contains("title") ? incidentRecord.GetAttributeValue<string>("title") : string.Empty;
if (context.Depth > 1 && preRegarding == null && postRegarding != null && caseTitle == postSubject)
//Your code is here
The above code is perfectly working for the scenario that I explained above but I am happy to hear suggestions and any scenarios that I have not considered.
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.
One of our customer reported that couple of Business Rules are not working in Mobile app which are working perfectly in Web application. Spent so much time to understand the problem with Mobile app and finally figured out that one tab on the contact form is not loaded in mobile app because of maximum 5 tabs allowed limitations. Some fields that we are referring in the business rules are part of this missing tab. So, business rule trying to lock (unlock, mandatory, setvalue etc.,) the field which is not loaded on the form and failing. Finally we decided to create a new form by considering the limitations with mobile app and the business rules that we implemented.
Below are the limitations of Forms in mobile app
You shouldn’t have more than 75 fields on the Form
You shouldn’t have more than 5 tabs on the Form
You shouldn’t have more than 10 sub grids on the From
I think the above numbers we can adjust with some settings but these are defined by Microsoft for optimal performance. The components that are exceeding the above numbers will not be shown on mobile app.
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.
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.
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.