The qbo.Attachment.Xceed IGenerator plugin has the ability to create zip files from other Attachments. This is useful for delivering a bunch of data to a client's FTP site, passing to an imaging system for processing, or other such use cases.
The simplest way to configure a recurring job is to:
This will create an Attachment containing all the Attachments bound to the Organization you chose.
The problem is, if you want to do this on a recurring basis, you should keep track of which attachments have already been zipped up, and just include those attachments that have not yet been zipped.
This can be handled using the Zip Generator's 'Link' ability.
The QBO ObjectLink table is used to track relationships between objects. In this example, when we zip up a bunch of Attachments, it'd be nice to know which zip file the attachment was linked to. The Zip Generator will pay attention to a Link parameter. If present, an ObjectLink will be created between the Attachment being zipped and the Zip file attachment. For example, assume the following attachments exist:
When generating the Zip file:
a new Attachment named 'All files for an Organization in one Zip file' will be created with, oh, say AttachmentID 121. In addition, 4 ObjectLink records will be created, one for each of the 4 attachments above, with:
Great; now our DBA can tell us which Attachments have been zipped!
Reverting back to our Attachment Template's Method, it was:
We can restrict the attachments returned with a simple parameter:
The ListWhere query will leverage the NotLinkedFrom filter to ensure that only rows without an ObjectLink record called 'Organization Zipped' will be returned.