01.05.2012, 18:11 | #1 |
Участник
|
ax_gfm_framework_team: Step 3: Perform initial wiring to Source Document Framework – document classes
Источник: http://blogs.msdn.com/b/ax_gfm_frame...t-classes.aspx
============== Now you need to implement few classes representing your source document. a) Create a class which extends SourceDocumentType.
- parmSourceDocumentHeaderRootNodeLabel(), parmSourceDocumentLineRootNodeLabel() : used by UI to display proper label for document header or lines respectively. - parmSubledgerJournalEntryType(): amounts (including matching amounts) are balanced by the framework across subledger journal entry types. - parmSubledgerJournalRelievingMethod(): in case of matching it specifies relieving method for amounts of the upstream document.
[SourceDocumentExtensionAttribute(enumNum(SourceDocument_MyDocument), SourceDocument_MyDocument::MyDocument)] b) Create a class which extends SourceDocument.
- Values would list all business event types specific to your document. Add values: None = 0, MyBusinessEvent = 1. - This will be used by attributes on extensions of AccountingDistributionRule, AccountingJournalizingRule and AccountingPolicy which you will create later.
- documentsBusinessEvent(): should return the BusinessEvent based on your newly created BusinessEvent_MyDocument enum - parmAccountingDate(): should return the accounting date for the document - parmBusinessEventDate(): the simplest implementation is already provided on the SourceDocument class - parmDefaultDimension(): if default dimension is provided, it is used by the framework to build ledger dimension c) Create class(es) extending SourceDocumentLineItem.
- calculateSourceDocumentAmountMap(): should return object of type SourceDocumentAmountMap representing collection of amounts to distribute for the line - documentsBusinessEvent(): should return a business event documented by given source document line. In the simplest form the code will look like the following: return new BusinessEvent(enumNum(BusinessEvent_MyDocument), BusinessEvent_MyDocument::MyBusinessEvent); - initializeImplementation() - intended to set up internal state - parmTransactionCurrencyCode() – should return the currency for the line
d) Keep document state persisted by the source document framework in sync with your document state. This is done by overwriting table insert() and update() methods on your document tables. Document header – insert() SourceDocumentProcessorFacade::submitSourceDocumentImplementation(this); SourceDocumentProcessorFacade::submitSourceDocumentLineImplementation(this); super(); Document header – update() super(); SourceDocumentProcessorFacade::submitSourceDocumentLinesForHeader(this, SourceDocumentLineAccountingStatus::FullyDistributed); Document line – insert() SourceDocumentProcessorFacade::submitSourceDocumentLineImplementation(this); super(); Document line – update() super(); SourceDocumentProcessorFacade::submitSourceDocumentLineImplementation(this); Источник: http://blogs.msdn.com/b/ax_gfm_frame...t-classes.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|