- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2020 08:24 AM
script working in portal view ......
but console view if i attach one attachment it is allowing to submit ticket ,but requirement is 2 attachment mandatory
so that is not working in console view...
function onSubmit() {
//Type appropriate comment here, and begin script belo
if (g_form.getValue('request') == 'Job')
{
try {
var msg = 'Please attached the job template(s) required and the COE approval email ';
var attachments = document.getElementById('header_attachment_list_label');
// g_form.addInfoMessage("Attachment visibility: " + attachments.style.visibility + " attachment display: " + attachments.style.display);
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none') {
alert(msg);
return false;
}
}
// For Service Portal
catch (e) {
var count = getSCAttachmentCount();
if (count <=1)
{
alert(msg);
return false;
}
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2020 12:51 AM
Hi Sai,
please refer below blog and it would help you solve that;
Verify Mandatory Attachments Count on Catalog Item
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2020 09:48 AM
RITM only , but it is not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2020 09:55 AM
Thanks. Can you uncomment //alert("Row "+rowcount); & check what is the count of attachments you get.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2020 08:39 PM
Hi Jaspal,
Thanks for your rply..
yes i tried (uncommented)- that time also not allowing to submit the ticket
now it is showing 2 alerts -"Row
and this alert More than 2 attachments are required.if attach any attachments it was showing like this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2020 08:52 AM
Please take a look at below blog:
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2020 09:50 AM
Hi Kumar,
Thanks For your rply
Can you please suggest 2 attachment mandatory in console view...you posted just one attachment or more but i want more than one like 2 and 3 and 4