02 August 2017

Customer postal address Primary address X++ code AX 2012 / Logistics postal address city, state and zip code

public LogisticsPostalAddress getPostalAddressByType(DirPartyRecId _party, LogisticsLocationRoleType _type)
{

DirPartyLocation partyLocation;
DirPartyLocationRole partyLocationRole;
LogisticsLocation location;
LogisticsLocationRole locationRole;
LogisticsPostalAddress postalAddress;
LogisticsElectronicAddress electronicAddress;

select firstonly postalAddress
exists join location
where location.RecId == postalAddress.Location
exists join locationRole
where locationRole.Type == _type
exists join partyLocation
where partyLocation.Location == location.RecId &&
partyLocation.Party == _party &&
partyLocation.IsPrimary == NoYes::Yes
exists join partyLocationRole
where partyLocationRole.PartyLocation == partyLocation.RecId &&
partyLocationRole.LocationRole == locationRole.RecId;

return postalAddress;
}

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...