Catalog client Script for field visibility
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 06:58 AM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
// return;
}
var tstate=g_form.getValue(state);
if (tstate == '-5'){
g_form.setVisible('u_priority_reason', true);
}
}
why isnt the above working?
- i have made u_priority_reason hidden onload
- i want To make it visible when the dropdown value of state is -5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 01:44 AM
still no luck!
i have put the alert in place and its not triggering. can you try hiding the field?
couple of things to highlight:
- it is a catalog client script
- for a particula rcatalog item
- applies on catalog task as well
latest Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
alert('CHECK CHANGE ALERT');
var tstate=g_form.getValue('state');
alert('tstate>>>'+tstate);
if (tstate == '-5'){
g_form.setVisible('u_priority_reason', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 01:52 AM
is the first alert coming?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 02:40 AM
No, it is not!
i have another script for hiding the same field onLoad which is working fine.
but am trying to make the same field visible onChange it is not working!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 03:29 AM
Try changing the order of the Script. Also check if there is any UI Policy for the same field. That might be the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 03:57 AM
check what value you are getting from state, Use log see that
var tstate=g_form.getValue('state');
if (tstate == '-5'){
g_form.setDisplay('u_priority_reason', true);
}