In this example I will be showing you how to get a sales order delivery address using below code.
Here, I'm inserting the data in my contract class to use in my API classes. Pleases change it according to your requirement.
logisticsPostalAddress = LogisticsPostalAddress::findRecId(salesTable.DELIVERYPOSTALADDRESS);
if(logisticsPostalAddress)
{
select RecId from logisticsLocation index hint
LogisticsLocationIdx where logisticsLocation.RecId == logisticsPostalAddress.Location;
select RecId from dirPartyLocation where dirPartyLocation.Location == logisticsLocation.RecId;
SalesAddressContract = new SalesAddressContract();
SalesAddressContract.parmAddressDescription(logisticsLocation.Description);
SalesAddressContract.parmDeliveryAddressName(DIRPARTYTABLE::findRec(dirPartyLocation.Party).Name);
SalesAddressContract.parmAddressStreet(logisticsPostalAddress.Street);
SalesAddressContract.parmAddressCity(logisticsPostalAddress.City);
SalesAddressContract.parmAddressState(logisticsPostalAddress.State);
SalesAddressContract.parmAddressCountryRegionId(logisticsPostalAddress.CountryRegionId);
SalesAddressContract.parmAddressZipCode(logisticsPostalAddress.ZipCode);
SalesAddressContract.parmAddressCountryRegionId(logisticsPostalAddress.CountryRegionId);
SalesAddressContract.parmsunTAFMarkForExtAddressCode(logisticsLocation.ExtAddressCode);// Custom field
addressList.addEnd(SalesAddressContract);
}
@Rahul
Here, I'm inserting the data in my contract class to use in my API classes. Pleases change it according to your requirement.
logisticsPostalAddress = LogisticsPostalAddress::findRecId(salesTable.DELIVERYPOSTALADDRESS);
if(logisticsPostalAddress)
{
select RecId from logisticsLocation index hint
LogisticsLocationIdx where logisticsLocation.RecId == logisticsPostalAddress.Location;
select RecId from dirPartyLocation where dirPartyLocation.Location == logisticsLocation.RecId;
SalesAddressContract = new SalesAddressContract();
SalesAddressContract.parmAddressDescription(logisticsLocation.Description);
SalesAddressContract.parmDeliveryAddressName(DIRPARTYTABLE::findRec(dirPartyLocation.Party).Name);
SalesAddressContract.parmAddressStreet(logisticsPostalAddress.Street);
SalesAddressContract.parmAddressCity(logisticsPostalAddress.City);
SalesAddressContract.parmAddressState(logisticsPostalAddress.State);
SalesAddressContract.parmAddressCountryRegionId(logisticsPostalAddress.CountryRegionId);
SalesAddressContract.parmAddressZipCode(logisticsPostalAddress.ZipCode);
SalesAddressContract.parmAddressCountryRegionId(logisticsPostalAddress.CountryRegionId);
SalesAddressContract.parmsunTAFMarkForExtAddressCode(logisticsLocation.ExtAddressCode);// Custom field
addressList.addEnd(SalesAddressContract);
}
@Rahul
Exactly, you're very kind of us about comment!.
ReplyDeleteon the site pozyczki-24.pl