Marking a field as True if Attachment is added to the form

Alon Grod
Tera Expert

Hi,


I have the field 'Attachment Added' of type True/False. I need to mark this field as True, if attachment is added to the incident form.

How can I achieve that?

1 ACCEPTED SOLUTION

Michael Ward
Kilo Guru

Hi Alon,

 

You could have a before insert business rule on the attachment table.

 

1. GlideRecord the incident table to query the incident number

2. While loop through the records to check if the worknotes contains "Attachment: " + current.file_name + " has been attached.";

3. set gr.attachment_added = true;

4. gr.update;

 

Let me know if this helps! 

View solution in original post

5 REPLIES 5

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Alon Grod ,

Please check out the below link which explains the possible ways to check if the attachment is attached on the form or not and based on that you can set your field.

https://www.servicenow.com/community/developer-articles/possible-ways-for-making-an-attachment-manda....

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.