AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.04.2012, 10:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
ax_gfm_framework_team: Step 2: Perform initial wiring to Source Document Framework – tables and maps
Источник: http://blogs.msdn.com/b/ax_gfm_frame...-and-maps.aspx
==============

The Source Document Framework (Accounting Framework) will provide functionality necessary to record business events and create accounting for the newly created document – accounting distributions and subledger journal entries. But you will need to inform the framework how to deal with your document.

a) Reference source document header
  • Modify the table definition of your document header table adding SourceDocumentHeader field of type SourceDocumentHeaderRecId.
  • Add your header table to SourceDocumentHeaderImplementation map (under AOT/Data Dictionary/Maps/SourceDocumentHeaderImplementation/Mappings) – adding a mapping to SourceDocumentHeader field from your header table.
  • Create an enum following the naming convention SourceDocument_MyDocument. Add values None = 0, MyDocument = 1. This enum and its values will be used by SourceDocumentExtensionAttribute to bind your classes to the framework in later steps.
  • Treat map as an interface: implement all methods from the map on the table – namely:
- parmSourceDocHeaderTypeEnumValue(): return appropriate value from the SourceDocument_MyDocument enum you created earlier

- parmSourceDocHeaderTypeEnumName(): return the name of the SourceDocument_MyDocument enum you created earlier

See existing implementations on CustInvoiceTable, VendInvoiceInfoTable and PurchTable tables for examples related to Customer Invoice, Vendor Invoice and Purchase Order documents respectively.

b) Reference source document line
  • Modify the table definition of your document line table adding SourceDocumentLine field of type SourceDocumentLineRecId.
  • Add your line table to SourceDocumentLineImplementation map (under AOT/Data Dictionary/Maps/SourceDocumentLineImplementation /Mappings) – adding a mapping to SourceDocumentLine field from your line table.
  • Create an enum following the naming convention SourceDocumentLine_MyDocument. Add values None = 0, MyDocumentLine = 1. This enum and its values will be used by SourceDocumentExtensionAttribute to tie your classes to the framework in later steps.
  • Treat map as an interface: implement all methods from the map on the table – is this step you will use new base enums created in prior step. The following methods need to be implemented:
- parmSourceDocLineTypeEnumValue(): return appropriate value from the SourceDocumentLine_MyDocument enum you created earlier

- parmSourceDocLineTypeEnumName(): return the name of the SourceDocumentLine_MyDocument enum you created earlier

- parmSourceDocumentHeader(): should return corresponding SourceDocumentHeader record

- parmParentSourceDocumentLine(): should return source document line which is a parent for given source document line (for example – tax line could return its parent invoice line)

- parmExchangeRateDate(): should return date of the exchange rate for given line

See existing implementations on CustInvoiceLine, VendInvoiceInfoLine and PurchLine tables for examples related to Customer Invoice, Vendor Invoice and Purchase Order documents respectively.

c) You may need to also modify your header table to be able to act like a line if you expect any accounting related to monetary amounts on the header. In Ax2012 an example of header related amount for which distributions are being created is Round-off (VendInvoiceInfoTable.InvoiceRoundOff).
  • In this case the header table needs do go through the same steps as the above step 2b described for the line table.
  • Add the enum value for the totals line (MyDocumentTotalsLine = 2) to the SourceDocumentLine_MyDocument enum which you created in step 2b.


Below is a data model diagram outlining the important relationships between your tables and the framework tables:






To be continued ...




Источник: http://blogs.msdn.com/b/ax_gfm_frame...-and-maps.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
xplusplus: Dynamics AX Application Object Tree (AOT) Blog bot DAX Blogs 0 25.11.2010 18:11
Dianne Siebold: Update on the Dynamics AX SDK Team kashperuk DAX Blogs 1 16.10.2007 08:23

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 01:11.