CRM 2016 JS – ReferenceError: is not defined at eval (eval at RunHandlerInternal)

 

Had an issue when attaching some code to the onload event on the leads entity. The TL;DR of the issue is that your code is syntactically incorrect, make sure that colons and semi-colons are in the correct space and make sure your opening and closing brackets are set.

Look at the below JavaScript:

Take the functioning JS below:

CRM does not like it when you use semi-colons instead of colons when trying to end a ‘case’ line. Make sure you’re using the correct syntax.

Jason
Jason
Microsoft Dynamics CRM 2011 Subject Matter Expert (Fully certified, including Sure Step, excluding Extending)