- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 12:31 AM
I've created the following onChange client script to automatically set the Caller Id and custom Company field on incidents.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
g_form.getReference('u_requestor', setContact);
}
function setContact(requestor) {
if (requestor && requestor.company != '')
g_form.setValue('caller_id', requestor.name);
g_form.setValue('u_company', requestor.company);
}
When I try to submit a new incident it gives me the error "Invalid update" and "Match not found, reset to original". When I try to change the company of an existing incident and then update the incident, my update to the company field isn't saved.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 01:05 AM
Hi @Abbottronix ,
Please use this script, it should work
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
g_form.getReference('u_requestor', setContact);
}
function setContact(requestor) {
if (requestor && requestor.company != '')
g_form.setValue('caller_id', requestor.sys_id);
g_form.setValue('u_company', requestor.company);
}
If my answer has helped with your question, please mark it as correct and helpful
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 12:44 AM
@Abbottronix Caller_id is a reference field and it expects a sys_id. Change your script as follows.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
g_form.getReference('u_requestor', setContact);
}
function setContact(requestor) {
if (requestor && requestor.company != '')
g_form.setValue('caller_id', requestor);
g_form.setValue('u_company', requestor.company);
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 12:52 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 01:05 AM
@Abbottronix Try the following version.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
g_form.getReference('u_requestor', setContact);
}
function setContact(requestor) {
if (requestor && requestor.company != '')
g_form.setValue('caller_id', requestor,requestor.name);
g_form.setValue('u_company', requestor.company);
}
This time it should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 01:11 AM
Hi Sandeep,
The field is now autofilling as hoped, but now the original problem has returned: