- 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 05:47 AM
Hi Jinhui
Can you share the image agin and also the UI Action code.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 06:56 AM
You should use below logic.
current.u_disability_report = true;
current.update();
action.setRedirectURL(current);
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 05:51 AM
Hello,
Can you try with this line
gr.u_disability_report=true;
i have removed the quotes as it is a boolean value some times this also effects.
please accept the solution or mark helpful if it solves the issue
thanks

- 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