- 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-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-04-2024 01:26 AM
Thanks @Sunil25
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 11:15 PM
hi try to write on change client script on change of caller field
var caller = g_form.getReference('caller_id');
var is VIP = caller.getValue('vip');
if(isVIP=='true'){
g_form.setValue('urgency',1);
alert('caller is vip');
}
- 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