Form is not reloading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 03:56 PM
Hi all,
Hopefully this is an easy one.
Situation
I created a BR to check for something in the change request form when using the 'request approval' button. if true a message should be displayed and abort action. Otherwise, it will move to assess.
Problem
Although the BR is triggered as expected, the message is displayed and the action is aborted. the form is not reloading. Hence, it appears to the user that the stage moved to assess and all fields are read-only (image attached).
The only way for the form to reload is to reload the browser.
BR details: Before Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 10:47 AM
Hi @El Cuchi
Check is any BR running on same and creating this issue.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 03:33 PM - edited 12-06-2023 03:45 PM
Hi @El Cuchi ,
The BR is checking the parent record of CHG and aborting the current action on that record which is about to apply by UI Action ( request approval ), this request approval is keeping the same record page after setting the value, infact BR is aborting the whole action along with redirect part.
UI Action runs on client side and BR runs on Server side , once BR abort BR don't know where it has to go unless redirect configured. My suggestion keep this logic check in UI Action, avoid the server job.
var value = current.getUniqueValue();
var gr = new GlideRecord('change_request');
gr.addQuery('parent', value);
gr.query();
if (!gr.next()) {
current.setAbortAction(true);
gs.addErrorMessage(' Bla Bla Bla Bla.');
response.setRedirectURL(current); // set the destination which is current record
}
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution