Its been a long time to write any new post on AX. Here I’m back today. Since few months we all are trying the new Dynamics 365 and its amazing new features in D365.
In this post we will see how to add new address fields in table using Table mapping.
[Note: In D365 we have object extension functionality to customize standard objects. But we don't have this option for Maps. This post will also help you to understand the alternative for the same by using table Mapping section.]
Requirement: We need to add all standard address fields in table followed by adding a new tab for address in respective from.
Proposed solution: We can achieve this by adding a single field rather than add multiple fields in table. Perform below steps to get this done,
1. Add a new field in table, EDT type “LogisticsLocationRecId”, rename it as “Location”.
2. Now add a new Foreign key relation for “LogisticPostalAddress” table and set its property as below snap shot,
3. Add a new map in mapping node for “LogisticsLocationMap”. Map field to location.
Your table must looks like below
Now we done with table customization, now we need do some addition on Form.
4. Firstly, Add new DS in your form, Table : “LogisticsPostalAddress”, set “LinkType” as “OuterJoin” with your main DS (where we added our new field “Location”)
5. Add a new tab page into your design with DS “LogisticsPostalAddress”(make sure it will be as per your from pattern)
Set Menu item object for menu item button as below table
|MenuItemButton||MenuItem Object Name|
6. Add below code
I. Form declation
II. Form init
public void init()
addressController = LogisticsPostalAddressFormHandler::newParameters(<maintable>_ds,LogisticsPostalAddress_ds);
III. New global method
public LogisticsPostalAddressFormHandler getAddressController()
IV. Active method of new DS (LogisticsPostalAddress)
public int active()7.Save all your changes, build project and run the Form. Your changes must looks like below,
ret = super();
You can make require changes and click on Ok button it will save your changes and on Form will show complete address in a single field (LogisticsPostalAddress.address)
Hope it will help…, Please keep sharing your comments and feedback.