- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 02:18 AM
Hello Team,
I have configured a variable named Contact Number for a record producer in Service Portal for creating a new Incident.
But unfortunately the Contact Number is not getting auto-populated when the form loads. And also when I change the Caller Name I need to remove the number which is populated and populate the Caller's Number in that field.
Can anyone let me know how to configure the same?
Thanks in Advance...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2022 12:03 AM
@SNOW
Was not able to login to community yesterday all day. Please find the solution below on how you can achieve your last bit of requirement as well:
Just write a catalog UI Policy on your Record Producer and clear out the value of your Contact Number field. Steps shown below:
No Script required:
Save the Form and scroll down to Catalog UI Actions and click on new and select the Contact Number field and then make sure to check the Clear value field as shown below:
This is working for me.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 04:50 AM
Hi,
Use this Catalog Client Script onChange of the caller field, UI type as All.
Replace the field names for caller and contact number according to yours:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
if(!isLoading && newValue == '') {
g_form.clearValue('contact_number');
}else {
var userID = g_user.userID;
g_form.setValue('caller_id', userID);
setUserPhone();
}
return;
}
if (newValue != '') {
setUserPhone();
}
function setUserPhone() {
g_form.getReference('caller_id', getPhone);
function getPhone(userRef) {
g_form.setValue('contact_number', userRef.mobile_phone);
}
}
}
Let me know in case of any issues.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 08:29 AM
Hi,
I tried implementing the script but it seems it is not working as expected.When I change the Caller Name the mobile number is not getting removed and it stays as it is.
Can you please help me out on this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 08:53 AM
Hi,
Can you please share the complete screenshot of the Catalog Client Script that you have written or would be better if you can share the XML of the script so that I can review that at my end?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 08:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 09:03 AM
Change the "Variable name" to caller as this would work on change of the caller field.