Mandatory confirmation on attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 07:49 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 01:54 AM
doesn't work i am able to save the change without attachments
my script include
Client script
what am i missing @Runjay Patel ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 02:48 AM
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
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 02:29 AM
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....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 03:01 AM
Hi @Runjay Patel @Sohail Khilji
Thanks for your input, i opted for a business rule and it works.
Regards
Ca
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 03:03 AM
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
-------------------------------------------------------------------------