Hi team,
I have done below code to get the Delivery address and name but the delivery POSTAL address is NOT fetching properly.
LogisticsLocationRecId locationRecId; LogisticsLocationRole role = LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Delivery); LocationRecId = LogisticsLocationDefault::findSimpleDefault(InventSite::find(this.InventSiteId), role).RecId; LogisticsLocation location = LogisticsLocation::find(locationRecId); this.DeliveryName = InventLocation::find(this.InventLocationId).Name; this.DeliveryPostalAddress = LogisticsPostalAddress::addressRecIdFromLocationRecId(location.RecId);
Kindly let me know where is the issue?
Pls give me more shed on this.
thanks!
Thanks Mohit for the sharing the below link
My issue has been resolved.
thanks bro
[ExtensionOf(tableStr(PurchTable))] final class PurchTableTbl_Extension { public void modifiedFieldWithUserInput(FieldId _fieldId, boolean _isFieldSetExplicitlyByUser) { VendTable vendTable; LogisticsLocationRecId locationRecId; //LogisticsPostalAddress address = LogisticsLocationEntity::findPostalAddress(this.InventSiteId, LogisticsLocationRoleType::Delivery); LogisticsLocationRole role = LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Delivery); locationRecId = LogisticsLocationDefault::findSimpleDefault(InventSite::find(this.InventSiteId), role).RecId; LogisticsLocation location = LogisticsLocation::find(locationRecId); ttsbegin; select forupdate vendTable where vendTable.AccountNum == this.OrderAccount; if (vendTable) { vendTable.InventLocation = this.InventLocationId; vendTable.InventSiteId = this.InventSiteId; vendTable.doUpdate(); } ttscommit; next modifiedFieldWithUserInput(_fieldId,_isFieldSetExplicitlyByUser); switch(_fieldId) { case fieldNum(PurchTable,OrderAccount) : this.DeliveryName = InventLocation::find(this.InventLocationId).Name; //this.DeliveryPostalAddress = LogisticsPostalAddress::addressRecIdFromLocationRecId(location.RecId); this.DeliveryPostalAddress = LogisticsLocationEntity::constructFromLocationRecId (InventLocation::getLocationFromRole(locationRecId,LogisticsLocationRoleType::Delivery)).getPostalAddress().RecId; break; } } }
thanks Mohit let me try this
The above code is providing you table buffer of LogisticsPostalAddress and you need to map its RecId in DeliveryPostalAddress field, so please use below code
this.DeliveryPostalAddress = LogisticsLocationEntity::constructFromLocationRecId(InventLocation::getLocationFromRole(inventLocation.RecId, LogisticsLocationRoleType:: Delivery)).getPostalAddress().RecId;
Hi Mohit,
I tried with the code which you mentioned, got below error. It seems datatype issue.
pls give me more shed on this.
thanks!
Sure Mohit, I will let you know
Hi, Please try this code
this.DeliveryPostalAddress = LogisticsLocationEntity::constructFromLocationRecId(InventLocation::getLocationFromRole(inventLocation.RecId, LogisticsLocationRoleType:: Delivery)).getPostalAddress();
If any issues, in above code then try this and let us know your test results
Please debug your code to check why it is not working. I cannot comment on that directly by seeing it.
Kindly verify my code pls. where is wrong? and if yes , kindly suggest me what to do
Hi, please use LogisticsPostalAddress asee tity and get the address from that. First give a SQL statement on that and you can see address in that. That will help you.
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156