Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

How to make ‘attach file’ as mandatory when claim damage request is selected as ‘Yes’.

Not applicable

Hi,

 

In record producer, I want to make ‘attach file’ as mandatory when claim damage request is selected as ‘Yes’.

 

Regards,

Sanju

5 REPLIES 5

Ravi Gaurav
Giga Sage

Hi @Community Alums 

 

You can write a onSubmit catalog Client Script like below :-

function onSubmit() {
if ((g_form.getValue('<variable_name>') == 'yes') &&
this.document.getElementsByClassName('get-attachment').length == 0) {

g_form.addErrorMessage(getMessage('Attachment is mandatory when Claim Damage Request is Yes.'));
return false; // Prevent form submission
}
}