I have 2 fields, "Is there Split Level Access?" (boolean) and "Split Level Access details" (memo). What I want to do is set up the "Split Level Access details?" field to be hidden unless you choose "Is there Split Level Acccess?" = Yes. At which point I want the "Split Level Access details" field to appear.
I have set an On Change event for field "Is the split level access?" with a webresource library gm_splitlevelaccess and the function called "Splitlevelaccess". The script is:
function Splitlevelaccess() {
var splitlevelaccess = Xrm.Page.getAttribute('gm_istheresplitlevelaccess').getValue();
if (splitlevelaccess == 2) {
// There is split level access. here are the details
ShowControl('gm_splitleveldetails');
} else {
// not split level access
HideControl('gm_splitleveldetails');
}
Now the problem I have is that the "Split Level Access details" field is not hidden when you load the form and then when you change the "Split Level Access?" question to "Yes", I get an error:
"There was an error with this field's customised event.
Field:gm_istheresplitlevelaccess
Event:onchange
Error: The value of the property 'Splitlevelaccess' is null or undefined, not a function object.
Can anyone tell me what is missing as I am stumped....
*This post is locked for comments
I have the same question (0)The best way to find out the problem is to debug the javascript. The error seems to be saying the function doesn't exist maybe
Splitlevelaccess
So have you attached the javascript to the form? You can do this by going to customization, form, form properties and then you need to add your javascript file to the manage libraries.
below are some useful links to debug your javascript
Debugging javascript
www.furnemont.eu/.../how-to-series-easily-debug-your-crm-javascript-code-in-ie8
this shows you how to get the debugger up
long javascript youtube tutorial