How to disable add/delete attachments on some change forms?

Community Alums
Not applicable

Change tickets are created from record producer. User attaches a word doc and that carries to the change ticket. User must not be able to edit/remove the attached file on change ticket. This is only on some change requests.

How to do this?

1 ACCEPTED SOLUTION

This works quite nice to set the internal can_write_to_record (sys_attachment) to false which hides all of the buttons, so the previous 2 changes are no longer needed.  Add in the HTML field, line 63 just before this line

 <j:if test="${jvar_attachment_disabled == 'true'}" >

<!-- If Firewall Change request, disable adding or removing attachments. -->
   <g:evaluate var="jvar_attachment_disabled" jelly="true">
		var cr = new GlideRecord(jelly.jvar_target_table);
	    cr.addQuery('sys_id', jelly.jvar_target_sys_id);
	    cr.addQuery('short_description', 'CONTAINS', 'Firewall Change');
	    cr.query();
	    cr.next();
	</g:evaluate>

View solution in original post

15 REPLIES 15

Community Alums
Not applicable

FYI, I had to keep the Delete in the business rule, because I have attachment related list tied to my change form. That part works fine.