Erstellen einer Nicht-Primären Adresse mit zwei Rollen

Beispiel, wie man per Code eine nicht-primäre Adresse mit zwei Rollen für einen Eintrag im Globalen Adressbuch erstellen kann.

static void createPartyInvoiceAndHomeAddress(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      = "Invoice & Home";
    dirPartyPostalAddressView.City              = "Vienna";
    dirPartyPostalAddressView.Street            = "Kärtnerring";
    dirPartyPostalAddressView.StreetNumber      = "22";
    dirPartyPostalAddressView.CountryRegionId   = "AUT";
    dirPartyPostalAddressView.IsPrimary         = NoYes::No;

    dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView, 
                                         [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Invoice).RecId,
                                          LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Home).RecId]);
}
Dieser Beitrag bezieht sich auf die Version:
Dynamics AX 2012

Kommentar hinzufügen
 
 

 

 
 
 
Beiträge des aktuellen Monats
März 2024
MoDiMiDoFrSaSo
 123
45678910
11121314151617
18192021222324
25262728293031
 
© 2006-2024 Heinz Schweda | Impressum | Kontakt | English version | Mobile Version
Diese Webseite verwendet Cookies, um Benutzern einen besseren Service anzubieten. Wenn Sie weiterhin auf der Seite bleiben, stimmen Sie der Verwendung von Cookies zu.  Mehr dazu