Configure Dynamics 365 plugin

Note: For the Dynamics 365 plugin v 6.0.19163.26775 or lower, Learn More

PluginAttributes List

DisplayName

​SystemName

​ShowOnExtensionWindow

​ShowOnToast

​Order

​FieldType

​Hyperlink

​OpenAutomatically

​​Category

​AccountId

​accountid

​TRUE

​FALSE

​1

​FALSE

​Account

​AccountName

​name​

​TRUE

​FALSE

2​

FALSE

​Account

​Fullname

​fullname

​TRUE

​FALSE

​1

​Search;#Name

​https://[CUSTOMERCRMENVIRONMENTURL]/main.aspx?etn=contact&pagetype=entityrecord&id=%7B[contactid]%7D​

​FALSE

​Contact

​FirstName​

​firstname

​TRUE

​FALSE

​2

​Search;#FirstName

​FALSE

​Contact

​LastName

​lastname

​TRUE

​FALSE

​3

​Search;#LastName

​FALSE

​Contact

​ParentCustomerId

​parentcustomerid

​TRUE

​FALSE

​4

​FALSE

​Contact

​EmailAddress1

​emailaddress1

​TRUE

​FALSE

​5

​Search;#SipAddress

​FALSE

​Contact

​EmailAddress2

​emailaddress2

​TRUE

​FALSE

​6

​Search;#SipAddress

​FALSE

​Contact

​EmailAddress3

​emailaddress3

​TRUE

​FALSE

​7

​Search;#SipAddress

​FALSE

​Contact

​Mobilephone

​mobilephone

​TRUE

​FALSE

​8

​PhoneNumber;#Search

​FALSE

​Contact

​Telephone1​

​telephone1

​TRUE

​FALSE

​9

​PhoneNumber;#Search

​FALSE

​Contact

​Telephone2

​telephone2

​TRUE

​FALSE

​10

​PhoneNumber;#Search

​FALSE

​Contact

​Telephone3

​telephone3

​TRUE

​FALSE

​11

​PhoneNumber;#Search

​FALSE

​Contact

​Address1_line1

​address1_line1

​TRUE

​FALSE

​12

​FALSE

​Contact

​Address1_postalcode

​address1_postalcode

​TRUE

​FALSE

​13

​Search;#ZipCode

​FALSE

​Contact

​Address1_city

​address1_city

​TRUE

​FALSE

​14

​FALSE

​Contact

​Address1_country

​address1_country

​TRUE

​FALSE

​15

​FALSE

​Contact

​ContactId

​contactid

​TRUE

​FALSE

​16

​Id;#Search

​FALSE

​Contact

​OwningUser

​owninguser

​TRUE

​FALSE

​17

​FALSE

​Contact

​OwnerId

​ownerid

​TRUE

​FALSE

​18

​Id

​FALSE

​Contact

​AccountId

​account.accountid​

​TRUE

​FALSE

​19

​Id

​FALSE

​Contact

​AccountName

​account.name​

​TRUE

​FALSE

​20

​Name

​https://[CUSTOMERCRMENVIRONMENTURL]/main.aspx?etn=account&pagetype=entityrecord&id=%7B[account.accountid]%7D​

​FALSE

​Contact

​CompanyName

​companyname

​TRUE

​FALSE​

​0

​Search;#Name​

​[websiteurl]​​

​FALSE

​Lead​​

​FullName​

​fullname

​TRUE

​FALSE

​1

​Search;#Name​

​https://[CUSTOMERCRMENVIRONMENTURL]/main.aspx?etn=lead&pagetype=entityrecord&id=%7B[leadid]%7D​

​FALSE

​Lead

​FirstName

​firstname

​TRUE

​FALSE

​2

​Search;#FirstName​

​FALSE

​Lead

​LastName

​lastname

​TRUE

​FALSE

​3

​Search;#LastName

​FALSE

​Lead

​LeadId

​leadid

​TRUE

​FALSE

​4

​Id;#Search

​FALSE

​Lead

​ParentContactId

​parentcontactid

​TRUE

​FALSE

​5

​Id

​FALSE

​Lead

​OwnerId

​ownerid

​TRUE

​FALSE

​6

​Id

​FALSE

​Lead

​WebSiteUrl

​websiteurl

​TRUE

​FALSE

​7

​​

​FALSE

​Lead

​Address1_PostalCode

​address1_postalcode

​TRUE

​FALSE

​8

​Search;#ZipCode

​FALSE

​Lead

​Address1_Line1

​address1_line1

​TRUE

​FALSE

​9

​FALSE

​Lead

​Address1_City

​address1_city

​TRUE

​FALSE

​10

​FALSE

​Lead

Address1_Country​

​address1_country

​TRUE

​FALSE​

​11

​FALSE

​Lead

​EmailAddress1

​emailaddress1

​TRUE

​FALSE

​12

​Search;#SipAddress

​FALSE

​Lead

​EmailAddress2

​emailaddress2

​TRUE

​FALSE

​13

​Search;#SipAddress

​FALSE

​Lead

​EmailAddress3

​emailaddress3

​TRUE

​FALSE

​14

​Search;#SipAddress

​FALSE

​Lead

​MobilePhone​

​mobilephone

​TRUE

​FALSE

​15

​PhoneNumber;#Search

​FALSE

​Lead

​Telephone1​

​telephone1

​TRUE

​FALSE

​16

​PhoneNumber;#Search

​FALSE

​Lead

​Telephone2

​telephone2

​TRUE

​FALSE

​17

​PhoneNumber;#Search

​FALSE

​Lead

​Telephone3

​telephone3

​TRUE

​FALSE

​18

​PhoneNumber;#Search

​FALSE

​Lead

​FullName

​fullname

​TRUE

​FALSE

​1

​Name

​FALSE

​ContactSearch

​ContactId

​contactid

​TRUE

​FALSE

​2

​Id;#ContactDetailField2

​FALSE

​ContactSearch

​Telephone1

​telephone1​

​TRUE

​FALSE

​3

​PhoneNumber

​FALSE

​ContactSearch

​​Title

​title

​TRUE

​FALSE

​1

​CaseTitle

​https://[CUSTOMERCRMENVIRONMENTURL]/main.aspx?etn=incident&pagetype=entityrecord&id=%7B[incidentid]%7D​

​FALSE

​Case

​Description

​description

​TRUE

​FALSE

​2

​CaseDescription

​FALSE

​Case

​TicketNumber

​ticketnumber

​TRUE

​FALSE

​3

​CaseTicke​Number​

​FALSE

​Case

​PriorityCode

​prioritycode

​TRUE

​FALSE

​4

​​CasePriorityCode

​FALSE

​Case

​CreatedOn

​createdon

​TRUE

​FALSE

​5

​CaseCreatedOn

​FALSE

​Case

​IncidentId

​incidentid

​TRUE

​FALSE

​6

​CaseId

​FALSE

​Case

​ContactId

​contactid

​TRUE

​FALSE

​7

​Search;#ContactId

​FALSE

​Case

​StateCode

​statecode

​TRUE

​FALSE

​8

​Search;#StateCode

​FALSE

​Case

​​StatusCode

​statuscode

​TRUE

​FALSE

​9

​CaseStatusCode

​FALSE

​Case

​CustomerId

​customerid

​TRUE

​FALSE

​10

​Search;#CustomerId

​FALSE

​Case

​AccountId

​accountid

​TRUE

​FALSE

​11

​Search;#AccountId

​FALSE

​Case

​ResponsibleContactId​

​responsiblecontactid

​TRUE

​FALSE

​12

​Search;#ResponsibleContactId

​FALSE

​Case

​PrimaryContactId

​primarycontactid

​TRUE

​FALSE

​13

​Search;#PrimaryContactId

​FALSE

​Case​

​Systemuserid

​systemuserid

​TRUE

​FALSE

​1

​Id

​FALSE

​SystemUser

​FullName

​fullname

​TRUE

​FALSE

​2

​Name

​FALSE

​SystemUser

​InternalEmailAddress

​internalemailaddress

​TRUE

​FALSE​

​3

​Search;#SipAddress

​FALSE

​SystemUser

​PersonalEmailAddress

​personalemailaddress

​TRUE

​FALSE

​4

​Search;#SipAddress​

​FALSE

​SystemUser

 

A brief summary of the plugin attributes list:

Category "Contact" and "Cases" contain the fields mapping of the crm fields that would be shown in Extension Window or plugin. The system name is the internal name of the entity object in Dynamics crm​.

In the plugin attributes where the hyperlink field has an filled in value. In this field is the hyperlink template stored. The plugin will use the hyperlink template to generate a hyperlink value so you can click on item and redirect to url.

 

How is the hyperlink generated of pluginattribute?

In this chapter will be explained how the hyperlink of an pluginattribute is generated. The "hyperlink" is the place where the hyperlink url template been stored. The plugin uses a hyperlink helper to generate the hyperlink based on the hyperlink url template and the retrieved entity collection from the dynamics365 crm environment.

Example of a hyperlink url template:

Copy
URL
​https://[CUSTOMERCRMENVIRONMENTURL]/main.aspx?etn=contact&pagetype=entityrecord&id=%7B[contactid]%7D

The [CUSTOMERCRMENVIRONMENTURL] is a place holder for the customer to fill in customer crm environment url.

Example of customer crm environment url:

Copy
URL
https://XXX.crm4.dynamics.com/main.aspx?etn=contact&pagetype=entityrecord&id=%7B[contactid]%7D

Everything in the hyperlink url template between "[" and "]" is a field attribute in the entity collection. The plugin will try to retrieve the value of the field attribute in the retrieved entity collection and replace the value with the field attribute between the "[" and "]".

The contact or account url link will be generated by the first plugin attribute where fieldtype equals to name and the "hyperlink" field of plugin attribute is filled with the hyperlink url template. And the hyperlink to a case in dynamics will be generated by the first plugin attribute where fieldtype equals to caseTitle and the "hyperlink" field of plugin attribute is filled in with the hyperlink url template.

 

Required Plugin settings

This chapter describes the minimal required plugin settings to connect to a customer Dynamics CRM environment to retrieve data. Plugin settings with scope "DynamicConfigSettings" are required to have a connection to the customer Dynamics CRM environment to retrieve data. The plugin will check is there a plugin setting with the name "DynamicsConnectionString". If there is no plugin setting with the name "DynamicsConnectionString" existst then the plugin will use the following plugin settings with name "DynamicsUrl", "DynamicsUserName", "DynamicsEncryptedPassword" and "DynamicsDomainName" to create a connectionstring to connect to the customer Dynamics environment.

The following plugin settings are required to retrieve data from the customer Dynamics environment:

  • ​Setting name "BaseContactsQuery" and scope "ContactsQuerySetting"

  • Setting name "BaseLeadsQuery" and scope "ContactsQuerySetting"

  • Setting name "BaseCasesQuery" and scope "CasesQuerySetting"

The plugin settings with scope "ContactsQuerySetting" are the base queries to retrieve contacts entity's from the customer Dynamics environment. The base contacts query are stored in the value of plugin setting with setting name "BaseContactsQuery" and the base leads query are stored in the value of plugin setting with setting name "BaseLeadsQuery".

The plugin setting with scope "CasesQuerySetting" is the base query to retrieve incident entity from the customer Dynamics environment. The base cases query are stored in the value of plugin setting with setting name "BaseCasesQuery".

The plugin will uses the plugin attributes with category "Contact" and the value of the plugin setting with name "BaseContactsQuery" and scope "ContactsQuerySetting" to generate a query called "FetchXml" to retrieve data (Contacts entity's) from the customer Dynamics environment.

The plugin will uses the plugin attributes with category "Lead" and the value of the plugin setting with name "BaseLeadsQuery" and scope "ContactsQuerySetting" to generate a query called "FetchXml" to retrieve data (Leads entity's) from the customer Dynamics environment.

The plugin will uses the plugin attributes with category "Case" and the value of the plugin setting with name "BaseCasesQuery​" and scope "CasesQuerySetting​" to generate a query called "FetchXml" to retrieve data (Incident entity's) from the customer Dynamics environment.

 

BaseQueries

This chapter describes how the basequeries works and will be further explaned.

All basequeries are fetch xml queries that been used to query the Dynamics environment to retrieve data.

For example: <fetch><entity name='contact'><link-entity name='systemuser' to='ownerid' from='systemuserid' link-type='outer' alias='owninguser'></link-entity><link-entity name='account' to='accountid' from='accountid' link-type='outer' alias='account'></link-entity></entity></fetch>

With the basequery above it will retrieve data from Dynamics entity "Contact" and retrieve data from entity "SystemUser" by the field "ownerid" in entity "Contact" and the field "systemuserid" in entity "SystemUser" with an alias name "owninguser". And it also retrieves data from the entity "Account" by the field "accountid" in entity "Contact" and the field "accountid" in entity "Account".

So if you want to retrieves data from an other entity that is not in the base query. You will need add the the "link-entity" xml part. And you need to know what is the foreign field of entity that has relation to. And the primary field of the entity you want to add.

And then add the field in pluginattributes. For example i want get the name of account. I need to add a pluginattribute with system name like "account.name", the systemname of an field of a linked entity its constructed with the alias followed by a dot and then the fieldname.​

Note: Yyou need to do this for linked entity fields with linked entitys, otherwise it will not work.

This is just an part of the whole query. It is just the base. The whole fetch xml query will be generated with the fields when it performs a search. The fields are listed in the pluginattributes list.

The best way to check is your base query or construct an base query is to download and use a program called "XrmToolbox". With this program you can construct and test your base query. The only thing is you need the connectionstring to your dynamics Environment.

 

PhoneNumberMatches

This chapter describes how the matching on phone number works. If there is no plugin setting exists with setting name "PhoneNumberMatches" or the value of setting is empty, the plugin then will use the default phone number matching (e.164) format. And ​if there is a plugin setting with setting name "PhoneNumberMatches" and the value of settings are filled in the plugin will use the value of plugin setting to match the incoming e.164 format phone number with the telephone number stored in the customer Dynamics environment. The value of plugin setting with setting name "PhoneNumberMatches" holds the several phone number match filters, each phone number filter are separated by the following separator ";"​.

 

PluginSetttings List

Setting

​Value

​Scope

​Prompt

​UseLeads

True

​CreateLeadsForMissedCalls

​False

​CreateWebChatActivity

​False

​​

​CreateMissedCallActivitiesForContacts

​False

​CreateCaseOnIncomingCall

​“ucc:subject;ucc_2;subject2”

​ContactsSearchFilters​

​“All Results, allresults:;Full Name, Name:;First Name, FirstName:;Last Name, LastName:;Zipcode, ZipCode:”​

​ContactsSearchFiltersSetting

​CaseSearchFilters

​“All Results, AllResults;Title, CaseTitle;Description, CaseDescription;Reference Number, CaseTicketNumber”

​CasesSearchFiltersSetting​

​CreatePhoneCallActivity

​False

​DynamicsServiceEndpoint

​/XRMServices/2011/Organization.svc

​MaxResultsContacts

​20

​MaxResultsCases

​20

​OnlyActiveContacts

​True

​SocialMedia

​FacebookId:assistantname

​ShowLeadStatuses

​“Open;Qualified”

​​AddTranslationToCrmActivity

​True

​CaseStatustype

​Statuscode

​AutoSelect

​False

​PhoneNumberMatches

​“+[country_code][national_number]{0,1}[national_number]{1};+[country_code][national_number]”

​ToastMessageSeperator

​-

​RetrieveCasesForContacts

​True

​SaveRecordingUrlToPhoneCallActivity

​False

​DynamicsFieldRecordingUrl

​DynamicsAppId

​BaseContactsQuery

​“<fetch><entity name='contact'><link-entity name='systemuser' to='ownerid' from='systemuserid' link-type='outer' alias='owninguser'></link-entity><link-entity name='account' to='accountid' from='accountid' link-type='outer' alias='account'></link-entity></entity></fetch>”

​ContactsQuerySetting​

​BaseLeadsQuery

​“<fetch><entity name='lead'><link-entity name=""contact"" to=""parentcontactid"" from=""contactid"" link-type=""outer"" alias=""contact""><attribute name=""contactid"" /></link-entity></entity></fetch>”

​ContactsQuerySetting

​DynamicsUrl

​<DynamicsUrl of clients Dynamics CRM environment>

​DynamicsConfigSettings

​DynamicsUserName

​<UserName of Dynamics User>

​DynamicsConfigSettings

​DynamicsEncryptedPassword

​<Encrypted password of the User in Dynamics>

​DynamicsConfigSettings

​BaseCasesQuery

​“<fetch><entity name='incident'><link-entity name=""contact"" to=""contactid"" from=""contactid"" link-type=""outer"" alias=""contact""></link-entity></entity></fetch>”

​CasesQuerySetting

​DynamicsDomainName

​DynamicsConfigSettings

​DynamicsConnectionString

​AuthType=Office365;Url=<DynamicsUrl of clients Dynamics CRM environment>;Username=<UserName of Dynamics User>;<Encrypted password of the User in Dynamics>

​DynamicsConfigSettings

​CaseCreateDateFormatSetting

​"dd-MM-yyyy"

​RetrieveOnlyOpenCases

​True

 

A brief summary of the plugin settings list:​

  • Settings with scope "DynamicConfigSettinngs" are required to have a connection to the customer Dynamics CRM environment to retrieve data. The plugin will check is there a setting with the name "DynamicsConnectionString". If there is no setting with the name "DynamicsConnectionString" the plugin will use the following plugin settings with name "DynamicsUrl", "DynamicsUserName", "DynamicsEncryptedPassword" and "DynamicsDomainname" to create a connection string to connect to the customer Dynamics environment.

  • Setting with name "ContactsSearchFiltersSetting" is the contacts search filter options.

  • Setting with name "CasesSearchFiltersSetting" is the cases search filter options.

  • Settings with scope "ContactsQuerySetting" are required to retrieve data from Dynamics CRM environment to map it to a Anywhere365 Contact or Lead object. Setting with name "BaseContactsQuery" are the base query to retrieve a Dynamics Contact entity to map It to a Anywhere365 Contact object. Setting with name "BaseLeadsQuery" are the base query to retrieve a Dynamics Lead entity to map it to a Anywhere365 Lead object.

  • Setting with scope "CasesQuerySetting" and name "BaseCasesQuery" are required to retrieved data from Dynamics CRM environment to map it to a Anywhere365 Case object. Setting with name "BaseCaseQuery' are the base query to retrieve a Dynamics Incident entity to map it to a Anywhere365 Case object.

  • Setting with name "UseLeads" is used to also retrieve Leads from the Dynamics CRM environment. If the value is "true" then it will also retrieve Leads and if the value is "false" then it will not retrieve Leads.

  • Setting with name "CreateMissedCallActivitiesForContacts" is a setting to automatically create activities for missed calls if the incoming phone number is from a known contact or lead if the value is "true". And if the value is "false" there will no activities been created.

  • Setting with name "MaxResultsContacts" is to set a max filter for the results of Contacts

  • Setting with name "MaxResultsCases" is to set a max filter for the results of Cases.

  • Setting with name "ShowLeadStatuses" is a setting to filter specific Leads with specific Lead statuses if the value is filled in. If there is no value is filled in then there is no filter applied to filter specific statuses and all statuses of Lead will be showed.

  • Setting with name "CaseStatustype" the CaseStatusType setting determines which status will be displayed in the Extension window. 3 types are supported:statecode, statuscode and default. The statecode shows info Active, Resolved, Canceled. The statuscode shows more detailed information like in progress, on hold, Waiting for details etc. The default only shows if a case is open or not.

  • Setting name with "PhoneNumberMatches" is a setting where different phone number matches format is specified separated by ';' to match phone numbers.

  • Setting name with "ToastMessageSeperator" is used to configure a specific separator to separate the toastA toast is a Skype for Business instant message notification the user receives on his desktop. message. If there is no value been filled in the default separator '|' will be used as separator.

  • Setting name with "RetrieveCasesForContacts" is made to enable or disable to search the related cases for contacts. If there is no "RetrieveCasesForContacts" settings exists or no value is been filled in then the default value will be used and that is "true".

  • Setting name with "SaveRecordingUrlToPhoneCallActivity" is made to enable or disable to save the recording url link to a phone call activity. If there is no "SaveRecordingUrlToPhoneCallActivity" setting exist or no value is been filled in then the default value will be used and that is "false".

  • ​Setting name with "DynamicAppId" is made to embed the filled in Dynamics App Id into the url links. If there is no value is filled in then there will no Dynamics App Id embedded in the url links.

PluginFlow Settings List

In this chapter will be the pluginflow settings described if there is any pluginflow settings applied to the plugin. With the pluginflow settings you can configure the call flow of Unified Contact Center.