- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2014 08:33 AM
Hi Guys,
I'm having some issues to update a field when user select an specific option on other field.
I have the Status field and according to the option user selects on this field, the Assigned To field needs to be populated or updated using the following script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) { var status = g_form.getValue('install_status'); if (status == 7) { g_form.setValue('assigned_to', 'ASSET RETIRED Generic User'); } else if (status == 9) { g_form.setValue('assigned_to', 'ASSET DISPOSED Generic User'); } else if (status == 6) { g_form.setValue('assigned_to', 'ASSET STOCK Generic User'); } }
The problem is: The field is automatically populating every time I change the Status field, but when I try to save or update the record, I'm getting the following error: "Invalid Update, Match not found, reset to original" but those three users in the script exists. If I try to update them manually, it works!
Any ideas on how to solve this issue?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2014 08:54 AM
Hi,
You have to use the script as :
g_form.setValue('assigned_to', 'sys_id of the user'); //you have to set the sysid of the user
Let me know if you have any questions
Thanks,
Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2014 08:54 AM
Hi,
You have to use the script as :
g_form.setValue('assigned_to', 'sys_id of the user'); //you have to set the sysid of the user
Let me know if you have any questions
Thanks,
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2014 09:01 AM
It works! Thanks Pradeep!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2014 09:25 AM
Or you can use g_form.setDisplayValue(assigned_to', 'ASSET RETIRED Generic User').