- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2023 07:26 AM
Hi!, I want my ui action to check if the user uploaded a new attachment, if he did, he can update, if not, he must cancel the record update
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2023 07:37 AM
you can use server side script in the UI action and check that
If it's validated then add your code which you want to run
if(!current.hasAttachments()){
gs.addErrorMessage("Please upload file");
current.setAbortAction(true);
}
else{
// add your code here which you want to execute when UI action is clicked
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2023 07:37 AM
you can use server side script in the UI action and check that
If it's validated then add your code which you want to run
if(!current.hasAttachments()){
gs.addErrorMessage("Please upload file");
current.setAbortAction(true);
}
else{
// add your code here which you want to execute when UI action is clicked
}
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