Mandatory confirmation on attachments

Carol2
Tera Contributor

Hi All 

 

I have a requirement I need assistance with "Mandatory confirmation on attachments for Implementation Plan, Test Evidence, Business Approval Pre and Post Implementation on all Changes" what could be the best way to create this confirmation?

 

User must be able to somehow tick that 3 attachments have been added to the change request before submitting. 

 

 

 

9 REPLIES 9

doesn't work i am able to save the change without attachments 

 

my script include 

Carol2_0-1732096381789.png

Client script

 

Carol2_1-1732096423718.png

what am i missing @Runjay Patel ?

Hi @Carol2 ,

 

alert attachmentCount to check what value coming from server side.

Also add gs.log(count) in script include and check see what value coming.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

Sohail Khilji
Kilo Patron
Kilo Patron

HI @Carol2 ,

 

There are 2 aspect to look and also depends how you can to take this customization.

 

First way :

1. You can create a on submit client script and script include that checks if the record submitted has 3 attachments added before the submission is made.  (in this case you never know if the user has updated the appropriate file which was expected, maybe you can check the file name on submission as an additional condition.)

 

in this way you can use the code given by @Runjay Patel  below to check the file and its name

 

Second Way :

You can introduce 3 new attachment field under the fields '' Implementation Plan, Test Evidence, Business Approval Pre and Post Implementation'' and apply UI policy to make the attachment mandatory.

 

I hope this helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Carol2
Tera Contributor

Hi @Runjay Patel @Sohail Khilji 

 

Thanks for your input, i opted for a business rule and it works. 

Carol2_0-1732100451322.png

 

Regards

Ca

Hi @Carol2 

 

Great ! Seems there is an issue with passing the sys_id from client script to script include.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------