diff --git a/Client Scripts/Set Urgency to High onChange of caller field/readme.md b/Client Scripts/Set Urgency to High onChange of caller field/readme.md new file mode 100644 index 0000000000..de3daa89ea --- /dev/null +++ b/Client Scripts/Set Urgency to High onChange of caller field/readme.md @@ -0,0 +1 @@ +This is a client script that change urgency to high automatically when changing caller field with the caller name whose vip is true diff --git a/Client Scripts/Set Urgency to High onChange of caller field/script.js b/Client Scripts/Set Urgency to High onChange of caller field/script.js new file mode 100644 index 0000000000..09a8566968 --- /dev/null +++ b/Client Scripts/Set Urgency to High onChange of caller field/script.js @@ -0,0 +1,13 @@ +function onChange(control, oldValue, newValue, isLoading, isTemplate) { + if (isLoading || newValue === '') { + return; + } + + var vipalert = g_form.getReference('caller_id',vipFunction); + function vipFunction(vipAlert){ + if(vipAlert.vip == 'true'){ + g_form.setValue('urgency','1'); + } + } + +}