I have a custom object which is created via an online form. It is possible to add attachments and this all works fine - the object is saved and so are the attachments.
In the 'after insert' trigger on the object I call a class which sends an email out with a pdf of the content of the newly added object, which all works nicely. The problem is I also need to include the attachments that were added to this new object, but it seems they are not yet attached before the end of the trigger. I've checked the debug log and the query for the attachments returns 0. Once the trigger completes the attachments are there.
Is there any way I can run the class I call from the trigger with a delay action? I have @future in the class, but it still seems to run immediately and not pick up the attachments.
Attachment
records also created asynchronously?