- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 11:36 PM
Hi All,
I have created a UI action 'Reject' for a form with the below script:
When I try to reject the request by clicking on 'Reject' it shows an error as comments are mandatory which is correct but at the same time it shows one message that 'Record updated'. Why this is happening?
Because it should not update the request if comments are empty. I want to hide that message as 'Record Updated'.
Thanks in advance,
Amol
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 11:48 PM
inside the else you should use return false
try that once
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 11:48 PM
inside the else you should use return false
try that once
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2023 12:04 AM
Hi @Ankur Bawiskar,
Thank you for you reply.
I have used current.setAbortAction(true); below the error message and it worked for me.
Thanks,
Amol