AXGuru | Dynamics 365 | Cloud Consulting Services | IT Solutions….

Address Fast Tab using Table map – Dynamics 365

Add address fast tab using Table map

In Dynamics 365 for Finance & Operations, 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 form.

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 of table for “LogisticsLocationMap”. Map field to location. i.e
LogisticsLocationMap.Location == theNewTable.LogsticsLocationRecId

4. Add new data source in your form, Table: “LogisticsPostalAddress”, set “LinkType” as “OuterJoin” with your main data source (where we added our new field “Location”)

5. Add a new tab page into your design with data source “LogisticsPostalAddress” ( make sure it will be as per your from pattern ).
6. Place an ActionPane to your form with the following MenuItemButtons and set object property for menu item button as below

MenuItemButton
Object name
NewAddress
LogisticsPostalAddressNewCustBankAccount

EditAddress
LogisticsPostalAddressEditCustBankAccount

ClearAddress
LogisticsPostalAddressClearCustBankAccount

MapButton
LogisticsPostalAddressMap

7. Place the following code to your form.

[Form]
public class AXG_AddrDemo extends FormRun
{
    // Form declaration
    LogisticsPostalAddressFormHandler   addressController;

    // Form Init
    public void init()
    {
        super();

        addressController = LogisticsPostalAddressFormHandler::newParameters(<maintable>_ds,LogisticsPostalAddress_ds);
        addressController.callerUpdateQuery(fieldNum(<maintable>,Location));
    }

    // Global method
    public LogisticsPostalAddressFormHandler getAddressController()
    {
        return addressController;
    }
    
    // Active method of new data source (LogisticsPostalAddress)
    Public int active ()
    {
        int ret;
       
        ret = super ();

        addressController.callerActive();
        addressController.callerUpdateButtons(newAddress,editAddress,clearAddress,mapButton);
       
        return ret;
    }
}

8. Save all your changes, synchronize, built project and run the form.

You can see new tab on your from and we can edit the same to do some changes as per requirement. Furthermore, once you’ll click on Edit button it will show all address fields. Moreover, you can also update information and then you need to click on OK button to make your changes in a visible state.

Happy Daxing…..!