- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 05:14 AM
Dear all,
I have a table that extend from Task table under Application Scope. I would like to set the Priority high when the requester is VIP.
I would appreciate you help.
Regards,
Hong
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 05:34 AM
Hi hongsok
We can do this with business rule but business rule will work after you saved the form.
With client script once you change the caller and if caller is vip then immediately priority will be set to 1- High
so Create a Onchange Client script on Called field and add below code
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var callerID = g_form.getReference('caller_id', setPriority);
function setPriority(callerID) {
if (callerID.vip == 'true') {
// Priority is depend on Imapct and Urgency.You need to set Impact and Urgency
g_form.setValue('impact', 1);
g_form.setValue('urgency', 1);
}
}
}
Kindly mark it correct and helpful if it solves your issue.
Thanks and Regards,
Anish kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 08:21 AM
Hi Hongsok,
You can also try out with onChange Client Script using getReference().
Here is the code:
Name:<name of your choice>
Table:<Table name>
Type: onChange
Field name: Caller
Script:
var caller = g_form.getReference('caller_id');
if (caller.vip=='true') {
g_form.setValue('impact', '1');
g_form.setValue('urgency', '1');
g_form.setValue('priority', '1');
}
Regards,
Subhojit