Attachment - make attachment mandatory based on variable value

kali
Tera Contributor

Hi All,

I have a catalog item on the portal . There is a reference variable and based on the reference variable the attachment should be mandatory. I am making the attachment mandatory as by using the portal setting . Please help me on this.

 

Thanks in advance

5 REPLIES 5

vishakhayadav24
Tera Guru

Hi @kali ,

 

you can check the below links for this you have to write onsubmit catalog client script.

https://www.servicenow.com/community/developer-blog/verify-mandatory-attachments-count-on-catalog-it...

 

Thank you,

Vishakha Y

vishakhayadav24
Tera Guru

Hi @kali  

 

you can use the below link  to write the onsubmit catalog client script and instead of var Requiredcount you can pass your variable .

 

https://www.servicenow.com/community/developer-blog/verify-mandatory-attachments-count-on-catalog-it...

 

Thank You!!

Vishakha Y

Rohit99
Mega Sage

Hi @kali ,

You can achieve mentioned requirement using Catalog UI Policy.

Considering reference field as user(sys_user).

Ex. when user is Abel Tutor then make attachment mandatory

 

Attaching screenshots for reference.

community_UI_Policy_01.PNG

 

community_UI_Policy_02.PNG

 

Please mark my response as correct and helpful if it helped solved your question.

 

Thanks,

Rohit Suryawanshi

kali
Tera Contributor

Hi @Rohit99 ,

Thanks for your response ,the solution you proposed is not working .