Archive
Posts Tagged ‘$ undefined’
ADX Portals 7.x – ‘Page_Validators’ is undefined
April 14, 2019
Leave a comment
Other day, while adding a custom validator using JScript on an Entity Form, I was getting ‘Page_Validators’ is undefined error, at below line of code.
// Add the custom validator to Web Page’s validators array
Page_Validators.push(spouseValidator);
Reason:
- The dynamics CRM form, associated to the ADX Entity Form, does’t have any required field, hence ‘Page_Validators’ array is NULL as ADX did’t need to load any validators.
Fix:
- ‘Page_Validators’ is a validator collection and we dont have control over this.
- Below workaround worked for us:
- Make one of the field as ‘Required’ by adding ‘Entity Form Metadata’. ADX instantiates ‘Page_Validators’ array, as there is Required field now.
- You can make the field as Non-required in the JScript.
Note:
- This behavior is fixed in further versions of ADX and Dynamics Portals.
đ
Categories: ADX, Dynamics Portals
$ undefined, ADX, Page_Validators
Xrm.Utility is undefined error – CRM 2011
August 26, 2013
Leave a comment
Other day when I deployed my solution on a new CRM server, I was getting âXrm.Utility is undefinedâ script error.
I referedâXrm.Utilityâ JScriptin my code to open forms which was causing script issue.
Reason & Fix
- The CRM server is not having UR 8
- Since Xrm.Utility object was added in CRM 2011 Update Rollup 8, installing UR 8 on server solved the issue
đ
Categories: CRM 2011, JScript
$ undefined, CRM 2011, JScript, Xrm.Utility
Using JQuery and Json in Ribbon button’s function handler
February 6, 2012
3 comments
Hi,
- In one of my CRM 2011 requirement, I had to update a record using ribbon button placed on CRM grid.
- I had written an update script which calls OData service using Json & JQuery. (link)
- But when I execute the function, I got â$ undefinedâ exception.
- I wondered since I already had âJson.jsâ & âJQuery.jsâ web resources added to my entity.
- After digging deeper, I came to know that, âJQuery.jsâ web resource is not getting loaded when my ribbon button’s function handler fired.
Fix :-
- I fixed the problem by loading âJQuery.jsâ web resource dynamically, before I call my update method.
- Below is the script to load the web resource’s
   var JScriptWebResourceUrl = “../WebResources/new_JQuery”;
var xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”);
xmlHttp.open(“GET”, JScriptWebResourceUrl, false);
xmlHttp.send();
eval(xmlHttp.responseText);
Hope it helps đ