- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 05:32 AM
function onClick() {
var gr = new GlideRecord('incident');
gr.addQuery('sys_id',current.sys_id);
gr.query();
while(gr.next()) {
gr.u_disability_report='true';
gr.update();
}
action.setRedirectURL(current);
}
If I click the button on the form, I want to update the "u_disability_report" field value to true.
However, the field value is not updated even when the button is pressed.
Do you know the solution?
Solved! Go to Solution.
- Labels:
-
Major Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 05:59 AM
Hi,
I think you checked "Client" Check box in UI Action, Uncheck it. You can use the below script to update current record in UI Action
action.setRedirectURL(current);
current.u_disability_report = true;
current.update();
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 06:21 AM
Thanks for your help.
I did it your way, and it works well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 06:03 AM
Hi,
I assume you have marked Client checkbox - True
On click - onClick()
Update script as this
function onClick() {
var gr = new GlideRecord('incident');
gr.addQuery('sys_id', g_form.getUniqueValue());
gr.query();
if(gr.next()) {
gr.u_disability_report = 'true';
gr.update();
location.reload(true);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 06:21 AM
Thanks for your help.
I did it your way, and it works well.