Code to find Electronic addresses from Postal Address AX 2012
Hi Folks,
Here I present the code to find the Electronic Addresses (Email / Phone / Mobile) of a Party using Logistics Postal Address framework in AX 2012.
static void FindEmailFromAddress(Args _args)
{
DirPartyTable dirPartyTable;
LogisticsPostalAddress postalAddress;
LogisticsElectronicAddress electronicAddress;
LogisticsLocation logLocation;
dirPartyTable = DirPartyTable::findByNum('000003452');
postalAddress = DirParty::findPostalAddressByRole(dirPartyTable.RecId, LogisticsLocationRoleType::Consignment_IN);
select logLocation where logLocation.ParentLocation == postalAddress.Location;
while select electronicAddress
where electronicAddress.Location == logLocation.RecId
{
info(electronicAddress.Locator);
}
}
Happy DAXing..
:)
Here I present the code to find the Electronic Addresses (Email / Phone / Mobile) of a Party using Logistics Postal Address framework in AX 2012.
static void FindEmailFromAddress(Args _args)
{
DirPartyTable dirPartyTable;
LogisticsPostalAddress postalAddress;
LogisticsElectronicAddress electronicAddress;
LogisticsLocation logLocation;
dirPartyTable = DirPartyTable::findByNum('000003452');
postalAddress = DirParty::findPostalAddressByRole(dirPartyTable.RecId, LogisticsLocationRoleType::Consignment_IN);
select logLocation where logLocation.ParentLocation == postalAddress.Location;
while select electronicAddress
where electronicAddress.Location == logLocation.RecId
{
info(electronicAddress.Locator);
}
}
Happy DAXing..
:)
Comments
Post a Comment