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
yes rite, sure Martin
Please read the previous replies. Both questions have already been answered there.
sure Martin, i believe this two are consider primary rite?
if not primary then how i will get?
It's called teleFax() in D365FO; I assume it's the same in AX 2012 too.
yeah rite, let me chk
for fax ? i could not find any method in company info
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.
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
Yes, Andre and Vushal
They are not marked Primary. Let me chk
Thanks
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'.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156