To make attachment mandatory on Native View of catalog item.

Mishu
Tera Expert

To make attachment mandatory on Native View of catalog item.

Got a related post for the same , It suggest for DOM manipulation . Can somebody please tell if using DOM manipulation will not impact anything later ?

@Ankur Bawiskar  Can you please advise ?

https://community.servicenow.com/community?id=community_blog&sys_id=00edd9751bb090d0ada243f6fe4bcba8&feedbackAction=comment

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this script in onSubmit would work fine for Native

function onSubmit(){

	var count = getCurrentAttachmentNumber();
	if(count == 0){
		alert('Please add at least 1 file');
		return false;
	}

}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this script in onSubmit would work fine for Native

function onSubmit(){

	var count = getCurrentAttachmentNumber();
	if(count == 0){
		alert('Please add at least 1 file');
		return false;
	}

}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

If i want to apply for both Native and portal then can u suggets without DOM manioulation ?

Hi,

I believe I have answered your original question on making attachment mandatory in native.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I am using the script you shared in your article.. As its only working fine for me in both ..

As i asked earlier , would it impact anything adversely later ?