On Click of UI action should not create a record in change table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 10:24 AM
Hello Experts,
We have an Ui Action on case table called Create Normal Change and we need to change the behaviour of that button.
Once we click on Ui Actio, It is inserting a new record in change table and copying some date from case to normal change.
So we need to change the behaviour like, Once we click on create change request button, It should redirect to new normal change page and populate some fields from case and show the pop up saying " Please save/submit the form to insert this change".
So it should not create a new record in table when we click create normal change, it should only insert when we click on save/submit in change record which got redirected.
Please help me with the code ASAP.
Pasting the example code below :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 08:10 PM
so you want user to be redirected to new change form with some fields auto-populated and then user will fill other fields and save the record?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 09:43 PM
Hi @Ankur Bawiskar ,
Yes, i am looking the exact requirement as you said. Please help me with the code.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 09:59 PM
you can use this script in UI action
var url = '/change_request.do?sys_id=-1^sysparm_query=requested_by=' + gs.getUserID() + '&short_description=' + current.short_description;
action.setRedirectURL(url);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader