Hi udhayachandranr,
Thank You for your response.
Here is the code:
PurchPurchaseOrderHeader purchPurchaseOrderHeader;
purchtable purch =purchtable::find(purchPurchaseOrderHeader.PurchId);
inventLocation = inventLocation::find(purch.InventLocationId);
if (inventLocation)
{
logisticsPostalAddress = LogisticsLocationEntity::findPostalAddress(inventLocation, LogisticsLocationRoleType::Invoice);
if (logisticsPostalAddress)
{
select firstOnly electronicAddress where electronicAddress.Type ==
LogisticsElectronicAddressMethodType::Phone
join contactLocation where contactLocation.ParentLocation == logisticsPostalAddress.Location
&& contactLocation.RecId == electronicAddress.Location;
purchPurchaseOrderHeader.InvoiceAddress=logisticsPostalAddress.Address;
purchPurchaseOrderHeader.Phone=electronicAddress.Locator;
}
}
But i am not getting the address based on invoice i am getting address based on delivery.What is the mistake here.