Contact Us Today!

Use the “Dependencies” tab on each function added to a Microsoft Dynamics CRM entity to avoid javascript errors

Use the “Dependencies” tab on each function added to a Microsoft Dynamics CRM entity to avoid javascript errors

Do you have a large team of developers that customize Microsoft CRM? Do you ever run into a problem when one developer removes a field from a form and then someone else’s javascript function throws an error? 

One of the best ways to avoid this issue is to use the “Dependencies” tab on each function added to a MSCRM entity. 

After adding your function to a web resource, you then call your function from a form event (onLoad, onSave, onChange). Within the Handler Properties dialog box of the added function, there is a tab called “Dependencies”. By adding fields to the right, it will lock those fields on the form unless removed from this list. 

So write your function. Add it to an event. Add any field within your function to the “Dependencies” list. Save and publish. 

Now if another developer tries to remove your field from the form, they will be warned that it is locked and being used by a web resource. 

Of course updating the list is necessary when updating your function. Always remember to remove any fields that have been removed from your code.

Handler1

Handler2

 

 


theProfessor

theProfessor

Rob is the CTO of Beringer Technology Group, and focuses his efforts on software development, cloud engineering, team mentoring and strategic technical direction. Rob has worked with Beringer since 2005, and has influenced every department from Development, Security, Implementation, Support and Sales. Rob graduated with his MBA from Rowan University in 2012, earned his Bachelors of Computer Science in 1997, and is current with several Microsoft technical certifications. Rob is very active, and loves to mountain bike, weight train, cook and hike with his dog pack.

Leave a comment!

You must be logged in to post a comment.