How can we disable the error Invalid value on Update?
This content was last updated in 2022. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2022 10:36 AM
For whatever reason, we're getting the following error after clicking a UI action even though the UI action is successful in setting all of the field values correctly. Since there really isn't an error, is there a line of code I can add to this to clear this type of alert message for this UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2022 10:42 AM
Hi,
I would try and find out where the error message is coming from and address the issue.
In my opinion hiding/suppressing the error is not a good idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2022 10:46 AM
The issue is pretty simple. SN doesn't like the bold line below. I can update literally any other field on the form and it's fine but when I update the class name it sends me an error (even though it actually changes the sys_class_name properly.
Side note: This class move is kosher. We have multiple extensions from the sn_customerservice_case table and every custom field is added to the base table directly so we can transfer cases from one type to another without any data loss.
(function executeRule(current, previous /*null when async*/) {
var cs = new GlideRecord('sn_customerservice_case_gcc');
cs.addQuery('sys_id', current.sys_id);
cs.query();
if (cs.next()) {
gs.log('Converting the new case to: ' + current.u_convert_case_to);
cs.sys_class_name = current.u_convert_case_to;
cs.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2022 10:55 AM
Ah oké, have you tried cs.setWorkflow(false); before the cs.update() line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2022 10:58 AM
Other option would be like HR does it, there, on transferring a Case they instead create a copy and set the old Case to Inactive. You then always have the old record for reference and do not have to change sys_class_name.
You can either transfer the number to the new Case record and the new generated Case number to the old (so switch numbers). Or give the new Case a new number and inform the user