How to write a script using script include to autosave the data upon clicking button in ServiceNow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 04:54 AM
Hi,
I have a requirement ,
1.Created one button using UI Action called "Approve RITM" on the RITM form. it wis working fine.
2.But before clicking that button, If I am adding anything on the form/changing any data, it is not saving that data.
So my question is If I am clicking the Approve button the data also should save whatever data I am adding on the form and RITM also should approve.
I have created the script include in the UI Action button, I will share the screenshot of my code, Please let me know what else needs to be added for saving the data along with Approval. Please find the below attached screenshot of my code.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 04:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 04:59 AM
Hi,
The code is only updating approval record not the RITM record.
Use current.update() in server script of UI action to save other changes as well