This blog will give you tools and hints on the development world, with a special regard on Microsoft Dynamics AX. You'll find also useful tips on the .NET world, Web Development, Mobile, Interfaces and maybe some tips on Android Java Games.
Wednesday, February 20, 2013
Create contact by code
static void ContactCreate(Args _args)
{
DirPartyRecId party;
DirPartyContactInfoView contactView;
DirParty dirParty;
LogisticsLocationRoleRecId role;
LogisticsLocationRole LogisticsLocationRole;
party = CustTable::find('CUSTOMER ID').Party;
contactView.LocationName = "Name";
contactView.Locator = "www.microsoft.com";
contactView.Type = LogisticsElectronicAddressMethodType::URL;
contactView.Party = party;
contactView.IsPrimary = false;
contactView.LocatorExtension = "";
role = LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Business).RecId;
dirParty = dirParty::constructFromPartyRecId(party);
dirParty.createOrUpdateContactInfo(contactView,[role]);
}
Subscribe to:
Posts (Atom)