This post is machine-translated. The original post in german language can be found here.

How to create a non-primary address in global adressbook

Example of how you can create a non-primary address for an entry in the global address book via code.

static void createPartyAddressNonPrimary(Args _args)
    DirPartyTable dirPartyTable = DirPartyTable::findByNum("???100000??");
    DirParty dirParty;
    DirPartyPostalAddressView dirPartyPostalAddressView;

    // Create instance of dirParty
    dirParty = DirParty::constructFromCommon(dirPartyTable, DirUtility::getCurrentDateTime(), dirPartyTable.partyType());

    // Create primary address
    dirPartyPostalAddressView.LocationName      = "Delivery";
    dirPartyPostalAddressView.City              = "Vienna";
    dirPartyPostalAddressView.Street            = "Kärtnerring";
    dirPartyPostalAddressView.StreetNumber      = "21";
    dirPartyPostalAddressView.CountryRegionId   = "AUT";
    dirPartyPostalAddressView.IsPrimary         = NoYes::No;

These post applies to following version:
Dynamics AX 2012

Add comment


Posts of the actual month
Februar 2023
© 2006-2023 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.