- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 10:56 PM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (g_form.isNewRecord()) {
var callercheck = g_form.getReference('caller_id', vipcallercheck);
return;
}
}
function vipcallercheck(callercheck) {
if (callercheck.vip == 'true') {
g_form.setValue('urgency', '1');
alert('Dear VIP Caller, you are setting the urgency to high');
return;
}
}
My solution is working fine. But I want to modify the code such that-
1. First it should set the urgency to high then it should send the alert but my code doing it in reverse order
2. If I choose a VIP Caller, then urgency change to high but if I change the caller again to a non-VIP user before submitting the form, I want the urgency value also change back to its default value what it was before.
Anyone please help me to figure this out.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 11:13 PM
You can try with below code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 11:42 PM
Hi @pk16514,
Try this modified client scripts -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (g_form.isNewRecord()) {
var callercheck = g_form.getReference('caller_id', vipcallercheck);
return;
}
}
function vipcallercheck(callercheck) {
if (callercheck.vip == 'true') {
g_form.setValue('urgency', '1');
alert('Dear VIP Caller, you are setting the urgency to high');
return;
}else{
g_form.setValue('urgency', '3'); // 3 is default value for Urgency
}
}
If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 02:01 AM
Hi @pk16514
As you accepted the solution but I am thinking is any OOTB way without code. I think Assignment Look up is the also a way to do. Give a try if possible.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************