Skip to content

Commit 974b815

Browse files
Create Set Urgency to High when Caller Change.js
1 parent d76f733 commit 974b815

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
2+
if (isLoading || newValue === '') {
3+
return;
4+
}
5+
6+
g_form.getReference('caller_id', function(caller) {
7+
if (caller.vip === true || caller.vip === 'true') {
8+
g_form.setValue('urgency', '1');
9+
10+
if (g_form.showFieldMsg) {
11+
g_form.showFieldMsg(
12+
'urgency',
13+
'Urgency automatically set to High because caller is VIP',
14+
'info',
15+
false
16+
);
17+
}
18+
} else {
19+
// Optional: Do nothing or reset urgency
20+
// g_form.setValue('urgency', oldValue);
21+
}
22+
});
23+
}

0 commit comments

Comments
 (0)