- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 07:37 PM
Hello,
I am not able to set value for the priority field based on the reference field(department). I created two fields department and priority. department is reference and priority is choice.
If i select customer support. priority should be changed to critical. if we select IT, priority should be changed to High.
My script is
var ge= g_form.getReference('group');
if(ge.name == 'IT')
{
g_form.setValue('priority','2');
g_form.setMandatory('emergency');
}
Can anyone help me out??
Thanks,
NItesh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 07:53 PM
You have to get reference like below
function onChange(control, oldValue, newValue, isLoading) {
var caller = g_form.getReference('group', doAlert); // doAlert is our callback function
}
function doAlert(caller) { //reference is passed into callback as first arguments
if (caller.name == 'IT')
{
g_form.setValue('priority','2');
g_form.setMandatory('emergency');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 10:03 PM
Hello Nitesh,
To add: Priority is auto calculated based on impact and urgency field. In this case, you will have to set the impact and urgency field.