Advertisements

{Dynamics CRM Rollup field} A UI based utility to pick and choose and update all the roll-up fields for your entity on-demand

Could not explain much about this utility with the title, so let me detail out the requirements here. Roll-up fields are great and here I am not going to talk about how it works and all. And after all it’s old enough topic I guess by now.

So what made to create this utility for such hackneyed topic. Well the requirement goes like this.

My customer had multiple roll-up fields on the account entity and they were scattered throughout the form across multiple tabs and sections to comply with their business. As good as roll-up fields are, they are updated every hour. However to calculate the roll-up fields on-demand you would need to click the refresh icon for each field.

We could have asked the users to do just like that. However there were couple of problems to it.

  • Some of the roll-up Fields were in the views but not on the forms. So even if the user wanted to manually update it, could not be done
  • The roll-up fields were scattered throughout the form across multiple tabs and sections as I mentioned earlier. So if a user needed to update a rollup field on-demand, he/she would literally need to find them across the form and click on refresh. Not a great idea everyone would agree.

 

So the customer walked up to me and asked. Can we have something which will allow me to pick and choose the roll-up fields for the entity even if not on the form and then allow me to update those fields on demand. And also he wanted something which could be easily moved across the environments and does not need a developer to maintain it.

Well, I thought for sometime and came out with a managed solution. All you need to do in install the managed solution in your environment.

The solutions are available for download at the following codeplex link – https://rollupfieldcalculator.codeplex.com/releases/view/631015

 

Once you install the managed solution in your environment, open any entity and you should see a button called ‘Calculate Roll-up Fields’

image

Once you click the button, a window will pop-up with all the roll-up fields for the entity.

 

image

As you can see from the above screenshot, the pop-up shows the ‘RollupField Email’ which rolls up the count of emails related to the account. The other two fields ‘Open Deals’ and ‘Open Revenue‘ which are not present on the form but still showing up.

 

You can pick and choose the fields that you want to Update and then click on the ‘Update’ button.

image

Once clicked, it will calculate all the roll-up fields that you have selected for update and then will refresh the form so that new values becomes visible to you.

Currently there are five emails associated with the account. Hence after I click on update the form refreshes and shows me the value “5” in the field.

image

Just a solution import and all you need is pick and choose your fields. No code, no customizations.

Hope you liked this tool.

 

Try our tools

Sharepoint Metadata Manager and Attachment Extractor (http://www.xrmforyou.com/sharepoint-integrator-1.html)

Role Based Views in Dynamics CRM (http://www.xrmforyou.com/role-based-views.html)

Multiselect Picklist Control (http://www.xrmforyou.com/multi-select-picklist.html)

Record Cloner (http://www.xrmforyou.com/record-cloner.html)

Advertisements

{Dynamics CRM + ISH} Enabling Opportunity and other non-listed OOB entities for Interactive Service Hub in Dynamics 365

As a dynamics CRM consultant, you come up with variety of requirements from customers. Some we achieve easily using the OOB ways with some customizations, some others need a complex workaround and then there would be some where we just have to be honest to our client and tell them that the feature they are looking for is currently not available in Dynamics.

And I came across a requirement of the last category from one of our customers very recently. They were using Interactive Service Hub hugely for their service module and their business was just too happy with the Interactive service hub. After all why not? The mobile look & feel, the tile views, the form, all look so nice.

While you get lost in the beauty of ISH, how about this requirement to pull you out of your utopia? “We want to implement ISH for our sales module as well. Opportunities, Leads etc etc”

My first and immediate answer was a big NO. After all Opportunity and lead are OOB entities for which ISH can’t be enabled. The immediate reply from our customer was why? If we can enable complex custom entities for ISH, then why not opportunity?

Could not commit to the customer as this is outside of Microsoft recommendation but I decided to give it a shot. Certainly, it can’t be enabled for Opportunity and Lead from the UI, but hey! what about doing it using SDK. I wrote the below code to enable Opportunity entity for Interactive Service Hub.

RetrieveEntityRequest entRequest = new RetrieveEntityRequest();
entRequest.EntityFilters = Microsoft.Xrm.Sdk.Metadata.EntityFilters.Entity;
entRequest.LogicalName = “opportunity”;

                RetrieveEntityResponse entResponse = (RetrieveEntityResponse)service.Execute(entRequest);

                var entMetadata = entResponse.EntityMetadata;
entMetadata.IsInteractionCentricEnabled = true;

                UpdateEntityRequest updateEntRequest = new UpdateEntityRequest();
updateEntRequest.Entity = entMetadata;

                service.Execute(updateEntRequest);

 

I ran the code and it much to my surprise, it ran without any errors. So CRM does not stop enabling of ISH for non-listed entities using SDK? Is the restriction only from the UI perspective? Well before jumping to conclusion, let us first check if the flag really got enabled.

I went to the Opportunity entity customization and below is what I could see.

image

Cool! the box is checked. Means my code has done the wonders.

But wait, does making this field enabled really work. So let’s find out.

I first created a Interactive experience form for Opportunity. In am not going to explain here, what is an Interactive Experience form and all. If you are not aware of Interactive Service Hub, I suggest you first get to know about it and then come back to this post.

image

 

The next I do is design a card form for the Opportunity entity.

image

 

So far so good! The next I did was create an Interactive Service Dashboard for Opportunity entity.

image

 

I save and publish all customizations. Now comes the toughest part. I have done all the customizations. But will Interactive Service Hub framework be able to render this. After all Opportunity is not something which is listed in the list of entities for interactive service hub.

 

I open ISH. And voila! it works. Below are the screenshots of how it looks in ISH.

image

 

image

image

 

Awesome. Isn’t it. I have tried this procedure with multiple entities which are not listed and all works great!

I am still to suggest this to customer as this is not something that has been officially recommended by Microsoft. However if you check this, we haven’t done any sort of unsupported customizations.

The question of my customer still comes to my mind with a bit of improvisation. “If ISH can render awesome views even for the entities which are not-listed, what is the main reason behind not exposing these OOB entities directly for ISH?”

 

Would like to know your views as well.

Hope this helps!

 

Try our tools

Sharepoint Metadata Manager and Attachment Extractor (http://www.xrmforyou.com/sharepoint-integrator-1.html)

Role Based Views in Dynamics CRM (http://www.xrmforyou.com/role-based-views.html)

Multiselect Picklist Control (http://www.xrmforyou.com/multi-select-picklist.html)

Record Cloner (http://www.xrmforyou.com/record-cloner.html)

{Dynamics 365/ CRM + Mobile Client} Useful Trick to debug your scripts in Dynamics CRM mobile client

No I am not going to put any MSDN link or try to explain how can you debug your scripts in tablet forms efficiently. After all we are in the world of interesting world of Dynamics 365 and writing something like that will be pretty banal.

However I am going to let you know one trick through which you can leverage the power of Developer tools of Chrome to debug your CRM scripts in tablets. And you might have been thinking that is something I have pulled out of my sleeve. Well, it’s not me but the brilliant Dynamics CRM Tip of the Day’ (http://crmtipoftheday.com/) guys where from I learnt this trick.

I was in one of the recent customer engagements and the customer was keen to bring in support for tablets and mobiles. They had some heavy customizations and they were getting left and right script errors when the forms were loading in tablets. Putting Xrm.Utility.alertDialog will only get you that far. And it was surprising that in-spite of they being pretty good on the platform, they were not aware of this trick suggested by ‘Dynamics CRM Tip of the Day’ guys. Below is a link to the same.

http://crmtipoftheday.com/2014/05/06/test-crm-for-tablets-from-a-pc-browser/

I  wonder why this is not suggested in many cases but this might really save you some serious time.

It’s a pretty old tip and hence I think people are not aware of it. Hence re-sharing. Believe me, after knowing this, if someone asks you to debug mobile scripts, you will find it easy like a piece of cake. And believe me, every tip I their blog is like gold dust.

I have been using it for pretty long time and yes it works for all versions. I have tried in Dynamics 365 and Dynamics 365 on-premises and it works like a charm. However do note that this works only in Chrome as far I have tested.

 

Sample Dynamics on-Premise with IFD url to access the mobile form in desktop browser.

https://<orgname>.<domainname>.com/nga/main.htm?org=<orgname>&server=https://<orgname>.<domainname>.com

Sample Dynamics 365 online url to access the mobile form in Desktop browser (North America Orgs)

https://<orgname>.crm.dynamics.com/nga/main.htm?org=<orgname>&server=https://<orgname>.crm.dynamics.com

 

You need to first launch chrome, put your Dynamics URL and then login. Once logged in successfully, take the mobile Url and paste in your browser. You should be good.

Debugging scripts is now just like the web client. All you need to do is put a debugger statement in script function you want and then just launch Chrome developer tools using F12. That’s all.

Below is the sample of screenshot of my Dynamics 365 on mobile client.

image

 

Hope this helps.

 

 

Try our tools

Sharepoint Metadata Manager and Attachment Extractor (http://www.xrmforyou.com/sharepoint-integrator-1.html)

Role Based Views in Dynamics CRM (http://www.xrmforyou.com/role-based-views.html)

Multiselect Picklist Control (http://www.xrmforyou.com/multi-select-picklist.html)

Record Cloner (http://www.xrmforyou.com/record-cloner.html)