Posting of your document usually consist of creating accounting entries in ledger and updating your document to posted state. Source Document Framework will help you create accounting.
a) Add code necessary to perform state update of your document during posting (for instance, you can add a field IsPosted to your document header and set it to Yes when the document is posted successfully) . This functionality will usually reside on a posting class specific to your document.
b) Wire your posting class to a “Post” button on your form through a menu item.
c) Make sure the source document implements parmCurrentVoucher() - this is used when generating accounting during document confirmation/posting.
d) Inside your confirmation/posting code, submit your document to the Source Document Framework calling:
SourceDocumentProcessorFacade::submitSourceDocumentImplementation(myDocumentHeader, true, SourceDocumentAccountingStatus::Completed);
The code above will generate accounting.
e) To validate the accounting, on your document form action pane you can add a “Voucher” button to view the voucher for your posted document.
Apply your range during initialization of the form calling updateQueryForMyDocument() from the form init() method - you will find examples of that examining existing code in the LedgerTransVoucher form init() method.