Just want to share with you short example of how you can copy Notes and Files from AP/AR invoices directly to General Ledger Batch.
For archive it we are doing following steps:
- Define extension for (AP/AR)ReleaseProcess graph. Exactly this graph is responsible for releasing operation.
- On the Initialize method we are trying to subscribe on InstanceCreated event for JournalEntry graph, where we can catch exact graph instance used for saving batch.
- InstanceCreated even is very useful for customization purposes. Here you can subscribe events and pass parameters between different graphs.
- Subscribe to ARRegister_BatchNbr_FieldUpdated to catch moment when batch is saved and linked to our invoice.
- Using graph and batch number we can find exact batch.
- Using PXNoteAttribute.CopyNoteAndFiles we can copy notes and files from one object to another.
Full Code Snippet:
Have a nice development!