+ Start a Discussion
Jason Kuzmak 12Jason Kuzmak 12 

Why doesn't this ContentDocumentLink ever hit trigger.new?

Hi all,

I'm working in Field Service Lightning. Our field service department wants an email to be sent to the customer as soon as a service report is generated.

I figured I'd build a trigger on ContentDocumentLink so I can construct an email as soon as the PDF becomes associated with the Service Appointment. Two are created: one associated to the user, and another to the Service Appointment. However...the ContentDocumentLink associated to the Service Appointment never enters trigger.new. It somehow gets into the system without firing anything or going through any of my code. 

I can query this record using Workbench afterward, however no debug logs show this record having ever existed. Why?

The dev console shows the link between the running user and the document:
User-added image
Workbench allows me to query the link between the document and the Service Appointment, which is the one I ultimately want to trigger from:
User-added imageI'm assuming the latter is inserted in future context. Does future context skip triggers?