Skip to main content

Notifications

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

Contact information for Customer and Legal entity

Posted on by 5,901

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 5,901 on at
    RE: Contact information for Customer and Legal entity

    yes rite, sure Martin

  • Martin Dráb Profile Picture
    Martin Dráb 229,275 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 5,901 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 229,275 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 5,901 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 229,275 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 5,901 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 5,901 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... 290,900 Super User 2024 Season 2 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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans