With the type 'Check In To Document Management' in the report rules it is possible to create a document revision with the report when printing a report. If I configure the Document No in the property list as follows 'DocumentNo=[@CUSTOMER_ORDER_IVC_REP/INVOICE_NO];' the revision is not created. If I omit the DocumentNo property, a new Document No is created each time the report is printed. How can I implement in the report rules that a document revision is created which is revised when the report is printed again?
Report Rules - Check In To Document Management
Best answer by Mathias Dahl
Hi Oliver,
I don’t think you can easily do what you want right now, assuming there is no document with the same Doc No as the invoice number at any given time the report rule is run.
The code that handles the "archiving" of the report/PDF has two "paths", you could say. Either you provide a document number, or you don't, and two different paths are taken.
If you provide one, and a document with that number exists, then a new revision is created and the PDF is checked in to it (assuming database storage is used for the document class in question). You can try this by manually creating a document with an invoice number you know, and then print that invoice.
If you don't provide a document number, well, then it works like what you have seen, that a new document is created and the PDF is connected to it.
So, the problem is that you want to combine these two pieces of business logic, but they don't work very well together.
In order to get new revisions of the same document created, you need to provide a document number, but you don't have that the first time the report is printed. And to get the document created in the first place you need to leave out the document number.
Something that might work is to set up a custom event that, when certain invoices are created (you need to find a good triggering point), then an empty document is created, with the document number set to the invoice number. Then, you have a report rule that sets the document number. Then, since the document exists, the "add new revision" logic should kick in.
Worth trying, perhaps?
/Mathias
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.