Every MS CRM implementation requires lot’s of JS code to implement validation and business logic using client side. As you know we can call MS CRM web services in JS to retrieve MS CRM data and insert ms crm data. But in MS CRM 4.0 there was no way to share JS code indifferent entities forms in supported way. You can create JS library in and load it in different ms crm entities forms, but it is unsupported in MS CRM 4.0. I have faced many issues while using external JS files in one of my MS CRM 4.0 implementations.
But now no need to worry about external JS files, MS CRM 2011 provide provides you OOB facility to use Common JS libraries in term of web resources. You can load your JS files using web resource, once loaded you can call your JS functions that are available in JS files. You can configure ms crm entity and attributes events to call this function and also you can pass parameter to that function. Thanks to Ayaz Ahmad, he has written a wonderful Post to demonstrate, how to use JS libraries in MS Dynamics 2011.
And If you are worried about how to convert your existing MS CRM 4.0 JS code to Dynamics 2011 JS code then here is a wonderful tool that you can use to upgrade your MS CRM 4.0 JS code to MS CRM 2011.
You can download MS CRM 2011 SDK for more Client-Side Programming Reference
If you are looking to run .exe from MS CRM 4.0, then you can do this easily. You can create a ISV button on MS CRM form and create on global function on formonload can call it in ISV button JS.. you can write below code to run .exe
var _Object=new ActiveXObject( “WScript.Shell” ) ;
you can also pass parameters with Run command.
Great link to watch Dynamics CRM 2011 Beta Viedeos
I have seen many developers facing issue of infinite loop while using update method inside update plugin. I know it could be requirement specific, to use update method inside update plugin. But sometime we can void infinite issue, there is no need of calling update method. You could play with inputparmeter propertybag. For example sometime we have requirement to calculate values based on the input values scenarios like this we don’t need to use update method. So the question is how to update record without using update method in update plugin. For scenarios like these we can register our plugin on pre state and can catch our inputs from inputpropertybag and after calculating our values we can add our new property of resultant value in inputpropertybag, so no need of using update method to save value in database.
We need to follow below steps
- Register preupdate plugin.
- Read required input values from inputparameter propertybag.
- Calculate your resultant value.
- Create new property of your resultant value.
- Add new property to input propertybag.
sometime we need to perform some action when activity is closed in MS CRM.In that case you have to capture close activity event, you can do this using event.Mode property in onsave event. you just have to write below code.
if(event.Mode==5) //Close activity event
//you code to implement your logic
As you know that we can set control formatting of bit field to use it as checkbox. But only changing formatting does not make it to behave like a checkbox because of onchange event. Let take an example for this, like we have one field “Calculate Value” and we want to calculate some value on the selection of this bit field. We can set control formatting for the bit field to display like a checkbox.
So if we will write some code onchange event of this bit field
You will not get this alert until you will move focus from this field. so make it to behave like real checkbox you have to attach onclick event with this field. You can do this using below code on form onload
after that you can simple check DataValue for bit ,if it is true or false to work accordingly