Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Get LogisticsElectronicAddress( phone, url) based on LogisticsPostalAddress and location roles

(0) ShareShare
ReportReport
Posted on by 323

Hi,

I am trying to fetch addresses and contact information based on location roles: Business /headcompany for PO report.

1.Business address is primary and I am able to get the address but cannot achieve the contact information.

2.For head company, I am not able to fetch the address either.

Please see the below code and let me know where I am gong wrong.

select firstonly postalAddress
	where postalAddress.Location == transTaxInformation.CompanyLocation;

LogisticsElectronicAddress electronicAddress;
dirPartyLocation dirPartyLocation;

select dirPartyLocation
	where dirPartyLocation.Location == postalAddress.Location
	join electronicAddress
		where electronicAddress.Location == dirPartyLocation.Location
		   && electronicAddress.Type == LogisticsElectronicAddressMethodType::Phone;

purchPurchaseOrderHeader.NAVBillToPhone = electronicAddress.Locator;

select dirPartyLocation
	where dirPartyLocation.Location == postalAddress.Location
	join electronicAddress
		where electronicAddress.Location == dirPartyLocation.Location
	       && electronicAddress.Type == LogisticsElectronicAddressMethodType::URL;

purchPurchaseOrderHeader.NAVBillToURL =  electronicAddress.Locator;
purchPurchaseOrderHeader.NAVBillTo = postalAddress.Address;
purchPurchaseOrderHeader.NAVRegdAddress = LogisticsPostalAddress::findByLocation(InventSite::getLocationFromRole(InventSite::find(purchTable.InventSiteId).RecId,LogisticsLocationRoleType::HeadCompany_IT)).Address;

Please help.

Thanks.

  • PriyaDutta Profile Picture
    323 on at
    RE: Get LogisticsElectronicAddress( phone, url) based on LogisticsPostalAddress and location roles

    Hi Girish,

    Thanks . This worked for me.

  • Verified answer
    GirishS Profile Picture
    27,823 Moderator on at
    RE: Get LogisticsElectronicAddress( phone, url) based on LogisticsPostalAddress and location roles

    Refer to the view named "LogisticsContactInfoView" - In that you need to map the postal address Location to ParentLocation field on that view to get the contact information against the address location.

    Thanks,

    Girish S.

  • PriyaDutta Profile Picture
    323 on at
    RE: Get LogisticsElectronicAddress( phone, url) based on LogisticsPostalAddress and location roles

    Hi Girish,

    Will this fetch contact information from  Organizations >LegalEntities > Addresses >Moe options>Advanced 

    Each address (business and headcompany) has different contact information inside above path .

    pastedimage1672837167848v1.png

    As I can see my contact information here but not in the DirPartyContactInfoView.

    Is there a way to fetch contact info for each address from above path ?

    Thanks.

  • GirishS Profile Picture
    27,823 Moderator on at
    RE: Get LogisticsElectronicAddress( phone, url) based on LogisticsPostalAddress and location roles

    Hi PriyaDutta,

    Try using DirPartyPostalAddressView and DirPartyContactInfoView to get address and contact details.

    Thanks,

    Girish S.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,233 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans