How do you make attachments not mandatory for a CheckBox variable?

Not applicable

Hi,

I have a variable (type = CheckBox) that when it is checked, I do not want the attachments on the SC item to be mandatory, otherwise if the CheckBox is not checked, it should be mandatory. I can't figure out how to achieve this. Can someone provide the best practice solution/suggestion please?

Thanks!

d_cammack
Tera Guru

Do you have attachments mandatory through a catalog client script?  If so, you can try getting the variable value and using it on a condition to run the script:

var chk = g_form.getValue('[checkbox variable]');
if (chk == false){
  // attachment mandatory script
}

Not applicable

I have Mandatory Attachment enabled from the portal settings of the catalog item. However, I don't want the attachment to be mandatory when I click on CheckBox variable. Can I achieve that from a Catalog UI Policy?find_real_file.png

Tony Villarrea1
Tera Contributor

Hi Preet,

 

I would utilize an advanced UI Policy. Set your filter requirements when checkbox = true.

Under script - execute if true, use the following code.

function onCondition() {
g_form.disableAttachments();

 

If my answer helped you, Kindly mark it as correct and helpful. 😉 

Not applicable

Tried that but it's not working.find_real_file.png