How to make attachment mandatory in a record producer creating an incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2019 03:05 AM
I have a record producer form creating an incident . It is accessed from the service portal. Attachment has to be made mandatory before submission of the form. Can anyone please suggest the best way to achieve it in Service portal? Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2019 03:20 AM
Hi Mark,
Thanks for the reply. I think we will not be able to use DOM methods. We are using London version. Is there any other way to achieve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2019 03:22 AM
Hi there,
We are currently also running this on London.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2019 03:31 AM
Other way could be to edit the Service Portal widget (see Göran Lundqvist's video's about that). Though, knowing that Madrid has an out-of-the-box feature for this, I would not recommend doing this.
The Madrid option:
If my answer helped you in any way, please then mark it as helpfull.
Please mark this answer as correct if it solves your problem. This will help others who are looking for a similar solution.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2019 07:45 PM
Hi Mark i am using your code on service portal but still after attaching the attachment its giving me alert again to attach the attachment .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2019 03:36 AM
We did this in one of our record producers .
In the client script, we used this code in our onSubmit.
var count = getSCAttachmentCount();
if(count <= 0) {
alert('You must attach the completed form before submitting this request.');
return false;
}
Thank you
Pankaj