In Snow, based on the selection of category ,attachment has to be attached. how to configure?

Nithya Devi
Tera Contributor

Based on the selection of category ,attachment has to be attached. For eg,we have attached 3 attachment in  Record producer,based on the selection of category any one attachment has to be attached.

Can anyone suggest an answer for the above query?

9 REPLIES 9

Anurag Tripathi
Mega Patron
Mega Patron

Very little info to go on. 

-Anurag

I have elaborated my query..

Here are a few similar question answered, they will give you the general query to validate whether 1 attachment is present or not, based on the selection on RP

How to make an Attachment mandatory in a record pr... - ServiceNow Community

 

 

Most easy would be somehting like this

function onSubmit() {
  
	if(this.document.getElementsByClassName('get-attachment').length == 0) {
		g_form.addErrorMessage(getMessage('Attachment is mandatory!'));

		return false;
	}	
   
}

Reference: How to make attachment mandatory in a record produ... - ServiceNow Community

-Anurag

Thanks for the immediate response.my requirement is not to make attachment mandatory, to attach appropriate attachment based on selection of categories in Record producer..