Dynamics 365 Query Not Working

Status
Not open for further replies.

WebMediafields

Bronze Partner
Basic Certified
Joined
Dec 1, 2017
Messages
20
Reaction score
1
I've noticed in the last week, possibly since the last update but it may have been longer that 3CX is not finding existing contacts in dynamics it just creqates new ones.

This is the query in the 3CX intergration:
Code:
https://[CRMURL]/api/data/v9.1/contacts?$select=firstname,lastname,_parentcustomerid_value,telephone1,telephone2,telephone3,fax,address2_telephone1,address2_telephone2,address2_telephone3,address2_fax,pager,emailaddress1&$filter=telephone1 eq '933689' or telephone2 eq '933689' or telephone3 eq '933689' or fax eq '933689' or address2_telephone1 eq '933689' or address2_telephone2 eq '933689' or address2_telephone3 eq '933689' or address2_fax eq '933689' or pager eq '933689'

I've noticed if i copy this request but instead change the 'eq' to endswith() it finds the contacts. The changed request would be:
Code:
https://[CRMURL]/api/data/v9.1/contacts?$select=firstname,lastname,_parentcustomerid_value,telephone1,telephone2,telephone3,fax,address2_telephone1,address2_telephone2,address2_telephone3,address2_fax,pager,emailaddress1&$filter=endswith(telephone1,'933689') or endswith(telephone2,'933689') or endswith(telephone3,'933689') or endswith(fax,'933689') or endswith(address2_telephone1,'933689') or endswith(address2_telephone2,'933689') or endswith(address2_telephone3,'933689') or endswith(address2_fax,'933689') or endswith(pager,'933689')

This returns the contacts. I don't know if it's a change in dynamics or the most recent 3CX update but it seems to have only started happending recently.
 
Yes, this is a change in the latest version of the template. Now the integration requires that there is a full match between the caller's number and the contact's number stored in the CRM. The recommended configuration is that you use numbers in E164 everywhere.
 
Yes, this is a change in the latest version of the template. Now the integration requires that there is a full match between the caller's number and the contact's number stored in the CRM. The recommended configuration is that you use numbers in E164 everywhere.
Problem is the 3CX intergration is still only sending the last 6 digits of the number so it's not matching with anything and has just created a load of new contacts.
 
Problem is the 3CX intergration is still only sending the last 6 digits of the number so it's not matching with anything and has just created a load of new contacts.
You change this from the 3CX Console > Advanced > Contacts > Options > Match exactly.
 
  • Like
Reactions: Evolute IT
@edossantos Can you tell me why this change in the Dynamics integration to Match Exactly is required now?
Is this because of a change by Microsoft?
 
@edossantos Can you tell me why this change in the Dynamics integration to Match Exactly is required now?
Is this because of a change by Microsoft?
There were cases in which the previous implementation was causing problems, for example calls between extensions through a 3CX bridge would trigger a contact lookup and match contacts with phone numbers ending with these 3 or 4 digits. Using E164 everywhere is the way to avoid this, as numbers are unique worldwide. SIP Trunks provide numbers in this format, so this is usually not a problem. You might need to run some script in the CRM to automatically reformat existing numbers though.
 
  • Like
Reactions: paul_carass
why previous we dun need using E164 format, now we need? there is not other choice if we dun wan using match exactly?
 
No, now you need to use Match Exactly. You can adjust the XML template if you want a different behavior.
 
  • Like
Reactions: Evolute IT
ation was causing problems, for example calls between extensions through a 3CX bridge would trigger a contact lookup and match contacts with phone numbers ending with these 3 or 4 digits. Using E164 everywhere is the way to avoid this, as numbers are unique worldwide. SIP Trunks provide numbers in this format, so this is usually not a problem. You might need to run some script in the CRM to automatically reformat existing
can i know how to adjust this xml template?
 
can i know how to adjust this xml template?
  1. From the 3CX Console > Settings > CRM > Microsoft Dynamics 365 > click Show Template.
  2. Copy the XML to a text editor.
  3. Change the Name attribute in the second line, from "Microsoft Dynamics 365" to "Microsoft Dynamics 365 Custom".
  4. Change the contact lookup scenarios (the ones without an Id attribute), adjusting the $select statement to what you need.
  5. Save the file as an XML file in your machine.
  6. From the 3CX Console > Settings > CRM > click Add, and then upload the template you modified.
 
  • Like
Reactions: Evolute IT
Hey @edossantos ,
Without hijacking this thread... I'm currently using the Salesforce (v1) integration.
I see the updated documentation for the SF integration also states that the Match Exactly rule must be turned on for it to work, and to use the V2 XML template.

If I stay on V18 and use the Salesforce V1 XML, will the Query work without having to reformat our numbers?
And is the v1 XML going to be retired anytime soon?
 
Hey @edossantos ,
Without hijacking this thread... I'm currently using the Salesforce (v1) integration.
I see the updated documentation for the SF integration also states that the Match Exactly rule must be turned on for it to work, and to use the V2 XML template.

If I stay on V18 and use the Salesforce V1 XML, will the Query work without having to reformat our numbers?
And is the v1 XML going to be retired anytime soon?
The Salesforce (v1) template is kept for backward compatibility, so existing users can keep using it. However, it's recommended that you move to SalesforceV2. The only difference is the authentication mechanism, in SalesforceV2 we use the full OAuth2 flow, and this means that we don't need to store your Salesforce credentials in 3CX, as we had to in the previous version. At some point we will remove the old template, but I can't tell when.

In addition, we're only adding new features to SalesforceV2. For example, chat journaling is only available in SalesforceV2.

The contact lookup logic is exactly the same in both templates. You can search using the last 7 digits, or the full match. The full match is recommended, because with the last 7 you could have false positive matches.... But if you prefer doing the match with 7 digits, it will work with SalesforceV2 exactly as it was in the old version.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,473
Latest member
NathanMitchell