Method to determine if an attachment exists

Scott Ness
Mega Contributor

Hello community.  I'm creating a scheduled script that will copy an attachment from event to alert.  Is there a condition that can be included in "addEncodedQuery" that will determine if the record has an attachment?

At present, I have -

emAttach.addEncodedQuery('source=email^state=Processed^alertISNOTEMPTY^message_keyISEMPTY');

If possible, I would like to add an additional condition to ensure only records that have an attachment are included.

TIA

1 ACCEPTED SOLUTION

Scott Ness
Mega Contributor

Thanks for the reply, but not exactly what I was looking for.  However, I did determine that hasAttachments() will work.

 

View solution in original post

3 REPLIES 3

AshishKM
Kilo Patron
Kilo Patron

Hi Scott, 

Please check in sys_attachment table for each event record if attachment is there or not.

Apply filter on Table Name ( event table name ) and Table Sys Id ( sys_is of event record )

 

find_real_file.png

 

Thanks,

Ashish

Please mark correct/helpful if it helps you

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Scott Ness
Mega Contributor

Thanks for the reply, but not exactly what I was looking for.  However, I did determine that hasAttachments() will work.

 

Hi Scott, 

Hope that my answer helps you , if so please mark correct/helpful for other community members.

 

Thanks,

Ashish 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution