码迷,mamicode.com
首页 > 其他好文 > 详细

A peek at Address Book in AX

时间:2015-03-02 16:34:14      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:

只要是用AIF Customer/Vendor service在AX里create/update customers/vendors,都要涉及到global address book。因此了解这个feature是很重要的。

 

Partial Data model of Address Book:

技术分享

 

主要介绍一些组成Address book framework的Tables/Views.

DirPartyTable(Party): 两种类型:个体(Customer/Vendor), 组织(Organization)

DirPartyLocation(Party Location): This is linked to party table and location table through its 2 fields: Party and Location.

They are both FK to RecIds on those tables.

技术分享

LogisticsLocation (Location):

This is the link between an physical address or a contact(email, phone,fax...) with Party(Customer/Vendor).

1. Contacts are not directly linked to Address. Rather they are very indirectly linked to Address through a shared location. 意思就是多个contacts地址共享一个location。

2. When we are trying to link a contact directly with a party, then the structure will be,

  • Location
  • Bunch of Contacts which point to this location

3. When we’re trying to link an address with contacts to a Party, then the structure will be,

  • Location(A)
  • Only one Address liked to this Location
  • Another location (B) with ParentLocation set to above Location A
  • Bunch of Contacts liked to the Location B

例如: Contact 1 --link to Address 1----link to Party 1

Address 1 ----Location A

Contact 1-----Location B, ParentLocation = Location A

LogisticsPostalAddress(Address): This table stores the actual physical postal address.  (Note: Postal address 有两个重要的字段:ValidFrom和 ValidTo。这表示可以有多个物理地址.)

 

LogisticsElectronicAddress(Contact):

This table stores all the contacts. Contacts are of 2 types

1. Contacts linked to Customer/Vendor directly

2. Contacts linked to a postal address

 

DirPartyPostalAddressView(Party address): This view gives us a list of all addresses that are linked to a Party.

例如,选出一个Customer(Party)的所有物理地址,

select * from DirPartyPostalAddressView a                                                            

join CustTable b on a.Party = b.Party where b.AccountNum = ‘2014’

技术分享

 

DirPartyContactInfoView(Party contact): This view gives us a list of all contacts that are linked to a Party.

例如,选出一个Customer(Party)的所有联系信息。

技术分享

 

LogisticsLocationAddressView( All postal address): This view gives us a list of addresses of all location

LogisticsContactInfoView(All contact info): This view gives us a list of contact info of all location

最后一个例子,选出一个Customer上关联的所有Postal Address上的所有Contact Info,

技术分享

 

总结:

1. 一个完整的ER如下:

DirPartyTable -- DirPerson(DirOrganization) -- DirPartyLocation -- DirPartryLocationRole

  |

  LogisticsLocation -- one DirPostalAddress

  LogisticsLocation -- one DirPostalAddress

  LogisticsLocation -- multiple DirElectronicAddress -- LogisticsLocationRole

 

2. 现有AIF Customer service不是一个干净的document service, 因为它的query里用的是View(不能create/update),AXd** class里重写了create/update address的逻辑。

A peek at Address Book in AX

标签:

原文地址:http://www.cnblogs.com/ivyliu/p/3748468.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!