- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 03:56 AM
Hello All,
I have Requirement, to make the managed attachments need to be mandatory while submitting the catalog item Request in ITIL view. Please refer the below screen shot.
i have tried the client script as below:
function () { [native code] }"
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 04:01 AM
this will work in native view
function onSubmit(){
var count = getCurrentAttachmentNumber(); // this function is out of the box
if(count == 0){
g_form.addErrorMessage('You must add an attachment before submitting this incident');
return false;
}
}
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
06-23-2023 04:01 AM
this will work in native view
function onSubmit(){
var count = getCurrentAttachmentNumber(); // this function is out of the box
if(count == 0){
g_form.addErrorMessage('You must add an attachment before submitting this incident');
return false;
}
}
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
06-23-2023 04:09 AM
It is working as expected in native view.
Thank you for the quick response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 06:57 AM
Hi Ankur,
You are always a Saviour .
Can you please let me know is there a way to make attachment not mandatory only for one subcategory on catalog item.
I have raised a new question
How to make attachment not mandatory based on subc... - ServiceNow Community
can you please help me