{CRM 2016 Update 1 Tips} Step by Step: Auto folder creation to SharePoint with Dynamics CRM

CRM is changing and very quickly – The way we guys configure and use CRM is also changing very fast.

This is a quick publish article covering a great new feature my colleague recently updated me on for CRM 2016 Update 1.

Remember the requirement where we needed to write custom code to automatically create SharePoint folder for document management when any entity was created.

Something like this: https://community.dynamics.com/crm/b/aeonnexuscrm/archive/2015/10/02/auto-create-sharepoint-folder-in-crm-online

Well, now it’s all configuration!

Here is a step by step:

· Go to Settings -> Document management -> Enable Server-Based SharePoint Integration

clip_image001

· All Topologies are supported now, in my case I am doing Online so selected the same:

clip_image003

· Apply SharePoint site URL and Click Next:

clip_image005

· Click Enable

clip_image006

· Success Message! Click Finish and before doing that Check the checkbox:

clip_image007

· Start selecting the entities(In my test org Account is renamed to Department) and mention SharePoint URL, Click next:

clip_image008

· Select as per below screenshot, notice that there is option for Automatic folder creation:

clip_image009

· Click Next and then Finish:

clip_image010

Now for some quick check: Created an Account:

clip_image012

Document folder was automatically created:

clip_image014

From SharePoint:

clip_image016

Great work Product team!

Hope it helps and Happy CRMing!

Twitter: https://twitter.com/msdynamicsblog
LinkedIn: https://www.linkedin.com/in/deepesh-somani-00296932

Google Play Store:

https://play.google.com/store/apps/details?id=com.dynamicsofdynamicscrm.msdynamicsblog&hl=en

Advertisements

{Survey} For What requirements do you use Plugins in Dynamics CRM?

Today’s post is a quick survey to check where do you guys need to use Plugins in Dynamics CRM.

I have given some common options, if you do not find an option, Please  mention it.

Thanks a lot and Happy CRMing!

Twitter: https://twitter.com/msdynamicsblog
LinkedIn: https://www.linkedin.com/in/deepesh-somani-00296932

Google Play Store:

https://play.google.com/store/apps/details?id=com.dynamicsofdynamicscrm.msdynamicsblog&hl=en

{Scripting Tip} Refresh form on save in CRM 2015/2016

CRM makes you re-learn your tricks of the game with each version. I had written this workaround for refreshing CRM 2013 form when the trick we guys used to use stopped working for CRM 2011:

https://dynamicsofdynamicscrm.com/2014/04/03/refresh-crm-2013-form-using-script/

This time I was suggesting this workaround for CRM 2015 and It would just not work for Save.

We ended up in a loop of refreshes for the form:

clip_image001

Well, no worries here is CRM 2015/2016 compatible solution:

· Add Modified on to your form

· Add following on change function to Modified on field on the form.

function onChangeModifiedOn()

{

//Needed to set form dirty to false explicitly as it is not done by platform

Xrm.Page.data.setFormDirty(false);
var Id = Xrm.Page.data.entity.getId();
Xrm.Utility.openEntityForm(“entityname”, Id);

}

Note: This has to be only triggered for existing form types, This will not work on Create mode.

This will solve your problem and save the day for you. Hope it helps and Happy CRMing!

Follow me on social channels:

Twitter: https://twitter.com/msdynamicsblog
LinkedIn: https://www.linkedin.com/in/deepesh-somani-00296932

Google Play Store:https://play.google.com/store/apps/detailsid=com.dynamicsofdynamicscrm.msdynamicsblog&hl=en

{Issue Resolution}Changing security attributes is not allowed in stage 20 plugins in Dynamics CRM 2015

Issue Description:

Recently in a migration project, we had a requirement to implement an override on Owner field.

We used plugins to achieve this and started getting following error message:

Changing security attributes is not allowed in stage 20 plugins.

clip_image001

Issue Resolution:

Plugin was set in Pre-Create stage.

Trying to find solutions some of the approaches that came across were:

· Turn plugin into Post-Create: This would not suit my case.

· Check plugin stage before running the assignment operation:

https://msdn.microsoft.com/en-us/library/gg327941.aspx#bkmk_PipelineStages

· Turn plugin into Pre-Validate stage.

I suggested the third route and it worked like a Charm.

CRM Tip: If you would like to understand about Pre-validation stage, here is a quick description from a great old colleague of mine: https://rajeevpentyala.com/tag/pre-validate/

Hope it helps and Happy CRMing!

Follow me on social channels:

Twitter: https://twitter.com/msdynamicsblog
LinkedIn: https://www.linkedin.com/in/deepesh-somani-00296932

Google Play Store: https://play.google.com/store/apps/detailsid=com.dynamicsofdynamicscrm.msdynamicsblog&hl=en