Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to make attachment mandatory in incident Form

sriram35
Kilo Guru

Hi 

we have a requirement called make attachment mandatory in the incident form

6 REPLIES 6

naveenmenon
Giga Contributor
Hey Sriram, Try this community post. https://community.servicenow.com/community?id=community_question&sys_id=e8e8cf61db5cdbc01dcaf3231f9619d9&view_source=searchResult

Sanket Khabiya
Kilo Sage

AbhishekGardade
Giga Sage

Hello Sriram,

You can check out my article on:

Possible Ways for Making an Attachment Mandatory : Service Portal/Native UI,

You can select incident table and do the same.

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

Yash Agrawal1
Tera Guru

 Hello Sriram,

Yes, you can make attachment as mandatory on the form.

 

Forex :if you are looking for "incident" form then write a "Business rule before insert"

 

Script:

if (current.hasAttachments() == true)  
 {  
gs.addInfoMessage('There is an attachment');  
}  
else  
{  
gs.addErrorMessage('There is no attachment');  
current.setAbortAction(true);  
}

 

I am attachment screenshot for your reference:

find_real_file.png

 

find_real_file.png

 Mark my Answer Correct once you complete your work my by script. 

 

 

Thanks

 Yash.K.Agrawal