Contact Number is not populating on Record Producer in Service Portal

SNOW46
Tera Contributor

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.

find_real_file.png

find_real_file.png

 

 

Can anyone let me know how to configure the same?

 

Thanks in Advance...

1 ACCEPTED SOLUTION

@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:

find_real_file.png

find_real_file.png

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:

find_real_file.png

This is working for me. 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

18 REPLIES 18

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.

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

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.

Change the "Variable name" to caller as this would work on change of the caller field.