Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Contact information for Customer and Legal entity

(0) ShareShare
ReportReport
Posted on by

Hi all,

Can you please let me know

1. How I will get Contact formation like Phone and Fax number from CUSTOMER  ?

2. How I will get Contact formation like Phone and Fax number from Legal entity ?

Through code.

Please give me more shed on this 

  • @rp@n Profile Picture
    @rp@n on at
    RE: Contact information for Customer and Legal entity

    yes rite, sure Martin

  • Martin Dráb Profile Picture
    Martin Dráb 230,994 Most Valuable Professional on at
    RE: Contact information for Customer and Legal entity

    Please read the previous replies. Both questions have already been answered there.

  • @rp@n Profile Picture
    @rp@n on at
    RE: Contact information for Customer and Legal entity

    sure Martin, i believe this two are consider primary rite?

    if not primary then how i will get?

  • Martin Dráb Profile Picture
    Martin Dráb 230,994 Most Valuable Professional on at
    RE: Contact information for Customer and Legal entity

    It's called teleFax() in D365FO; I assume it's the same in AX 2012 too.

  • @rp@n Profile Picture
    @rp@n on at
    RE: Contact information for Customer and Legal entity

    yeah rite, let me chk

    for fax ? i could not find any method in company info

  • Martin Dráb Profile Picture
    Martin Dráb 230,994 Most Valuable Professional on at
    RE: Contact information for Customer and Legal entity

    Why did you duplicate the code instead of just calling the method?

    CompanyInfo::find().phone()

    If it doesn't work, you don't seem to have the right data in the current company.

    The debugger might help you to understand what's going on in your system.

  • @rp@n Profile Picture
    @rp@n on at
    RE: Contact information for Customer and Legal entity

    Vishal,

    as you mentioned

       display Phone phone()

       {

           LogisticsElectronicAddress electronicAddress;

           electronicAddress = DirParty::primaryElectronicAddress(this.RecId, LogisticsElectronicAddressMethodType::Phone);

           return electronicAddress ? electronicAddress.Locator : '';

       }

    here this. recid means companyinfo.recid  rite?

    i wrote below code for phone and fax for company

    company         = CompanyInfo::find();

    logisticsElectronicAddress3 = DirParty::primaryElectronicAddress(company.RecId, LogisticsElectronicAddressMethodType::Phone);
    if(logisticsElectronicAddress3)
    {
    locator3 = logisticsElectronicAddress3.Locator;
    }

    logisticsElectronicAddress4 = DirParty::primaryElectronicAddress(company.RecId, LogisticsElectronicAddressMethodType::Fax);
    if(logisticsElectronicAddress4)
    {
    locator4 = logisticsElectronicAddress4.Locator;
    }

    is it rite? becuase value is not coming. i marked primary for both

  • @rp@n Profile Picture
    @rp@n on at
    RE: Contact information for Customer and Legal entity

    Yes, Andre and Vushal

    They are not marked Primary. Let me chk

    Thanks

  • Suggested answer
    Vishal Dhavgaye Profile Picture
    Vishal Dhavgaye 405 on at
    RE: Contact information for Customer and Legal entity

    Hi @rp@n,

    Above code is to get the primary contact information of customer and company.

    Can you please check if contact information is added to customer and company and if it is primary.

    If you are trying to get contact information which is not primary, you can get it by following code,

    phone = conPeek(DirParty::electronicAddressLocatorsByRole(companyInfo.RecId,
                                                    LogisticsElectronicAddressMethodType::Phone,
                                                    'Delivery'),1);
     

    'Delivery' in above code is contact 'purpose', Please make sure you are passing correct 'purpose' in the code. You can check that by selecting contact record -> Click advanced and check 'purpose'.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,234 Super User 2025 Season 1 on at
    RE: Contact information for Customer and Legal entity

    Hi @rp@n,

    Have you checked if the phone and fax records for this customer are marked as primary? This coding is searching for records with the field Primary checked.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,234 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans