Install CRM Service for WebAgent

Note This feature requires an additional plug-in. Please contact your Sales Contact to verify if a plug-in is purchased.

Introduction

The CRMCRM stands for Customer Relationship Management and is a method/technology for managing your external interactions and relationships with customers. Integrate Anywhere365 with your CRM client to show customer information alongside your inbound and outbound interactions. Service shows information about the caller. It uses two lists in SharePoint for its configuration: PluginSettings and PluginAttributes. Only one PluginSetting is required to enable the CrmService with its default configuration: ConnectionString.

Create a new PluginSetting item in SharePoint with ConnectionString as title and CrmService as scope. The value must be the connection string. Please read "Use connection strings in XRM tooling to connect to Common Data Service" how to construct the value. Anywhere365 allows encryption of the password using the A365.PWTool.exe and replacing the Password parameter with the EncryptedPassword parameter.

 

Installation

Modify Properties.ps1 using a text editor and run InstallCrmService.ps1 as Administrator from its directory.

Add the CRM Service’s settings endpoint (api/v1/settings) URL to the ListsPlugin’s ListsEndpoints setting, e.g. http://localhost/CrmService/api/v1/settings. Add a new PluginSetting with CrmServiceUrl as title and WebAgentService as scope. The value must be the base CRM Service URL, e.g. http://localhost/CrmService.

 

PluginAttributes

This list contains the items which are shown to the user in the Web Agent and ID’s used to identity unique entities. All items are grouped by the Category.

Note Only modify this list if you want to deviate from the default PluginAttributes. See Predefined PluginAttributes for the defaults and how to override these defaults.

 

The PluginAttributes list contains the following columns:

Column

Meaning

DisplayName

Name of the property shown in the Web Agent.

SystemName

Must be the Dynamics 365 attribute. If it is part of a linked entity then the alias must precede the attribute.

ShowOnExtensionWindow

Indicate that the property is visible in the Web Agent. The main reasons to set this to ‘No’ and still configure it as an item is when the property should not be shown, but is used in a Hyperlink or it’s an ID.

Order

The order in which the property is to be shown.

Important: counting must restart for each Category.

FieldType

Zero or more field types, these are covered per Category later on.

Hyperlink

Make the property clickable with the Hyperlink specified. It is possible to include the value of a property in the Hyperlink. This is done by putting the value of a SystemName property in square brackets in the Hyperlink. For example if there is a property with the SystemName ‘Example’, then the URL becomes: http://www.example.com/?queryString=[Example]

OpenAutomatically

Ignored by the CrmService.

Category

The Category for this item.

ShowOnToast

Can be used to force the inclusion of the attribute in the query.

It is possible to combine the values of several properties, for instance when a name is split up in multiple properties, e.g. a FirstName and LastName column. In this case both properties should have the same DisplayName and they should appear after each other in Order, e.g. 1 and 2.

Note ContactSearch will fall back to Contact if no items are supplied for the ContactSearch category. The same rule applies to Lead, LeadSearch, Case and CaseSearch. Only Contact is mandatory to have items.

 

Contact

The items in this category are the properties shown of a single contact. It supports the following field types:

Field type

Description

Id

This field type in combination with a value in the Hyperlink column, will be shown as CRM link.

Name

The name of the contact which will be shown as the contact’s title.

PhoneNumber

Column may contain a phone number.

SipAddress

Column may contain a SIP-address.

Email

Column may contain an e-mail address.

Date

Column contains a date (and time).

Search

Column is searchable. This type should be set for each column containing a PhoneNumber, Email or SipAddress to search for a contact match. This type will also mark a field as a search option if no ContactSearch items are configured.

 

ContactSearch

This category is used to display a summary of the contact and used for searching contacts. All properties which should be searchable, must have the Search field type. The column containing the values to verify the identity of the caller, e.g. a zip code, must have the field type Verify.

 

Lead and LeadSearch

See Contact with regards to Lead and ContactSearch for LeadSearch.

 

Account

This category is used to keep consistency in the other categories. It is used to define the relation between the contact and its account. A lead can only have a company name which may later be part of the contact when the lead is promoted.

Note Do not include the account alias in the SystemName column.

Note Set order to 0 if it is an account attribute which is not linked to the account entity, e.g. companyname in the lead entity.

The field types of importance here are Name, PhoneNumber, SipAddress and Email. All items with the field type Name are combined to form the title. The property with any of the others is used as a subtitle.

 

Case

Note Only contacts can have cases.

The DisplayNames in this category are fixed. The following items are supported:

DisplayName

Description

Title

Multiple items can have this DisplayName. Must have the Name field type.

Description

Only a single item is allowed to have this DisplayName.

Date

Must have the Date field type to be used.

Status

The case status including the case status colors. The values must match the CaseStatus setting. Add field type FormattedValue to obtain the display name of this property.

It is also possible to add a ID field type to an ID item or any of the other items. The ID field type in combination with a URL in the Hyperlink column will be shown as a CRM link for each case.

 

CaseSearch

These must have the same items as the Case category. The difference here is that items may have the Search field type.

 

PluginSettings

Note Al plugin settings for the CrmService must have the Scope set to CrmService. A number of plugin settings have already been set.

Note These predefined settings may be overwritten by creating a PluginSetting item in SharePoint with the same Title and Scope.

Setting

Value

ConnectionString

The Dynamics 365 connection string. The only mandatory setting that must have a value.

ShowStatus

Show what kind of contact is calling. Can be a Contact, Lead or Unknown. Default True.

DefaultPhoneNumberRegion

Iso 3166 alpha-2 code. Default ZZ.

PhoneNumberFormat

The format used when searching the CRM when a call comes in. There are four values:

  1. E164: e.g. +0012345678. See “The International Public Telecommunication Number Plan”.

  2. International: e.g. +1 206-555-1234. Based on the E.123 International format.

  3. Rfc3966: e.g. tel:+1-206-555-1234. See “The tel URI for Telephone Numbers”.

  4. Wildcard: do a wildcard search. Default.

Important: change this setting if phone numbers are stored in any of the other formats to improve performance.

CaseStatus

Mapping of a case (incident) status (statuscode) to a WebAgent status. Default:

Active=Open

Resolved=Closed

Canceled=Closed

In Progress=Open

On Hold=Open

Waiting for Details=Open

Researching=Open

Problem Solved=Closed

Left side is the formatted value as configured in Dynamics, see also "MS CRM Dynamics Entity StateCodes and StatusCodes", the right side is either New, Open or Closed.

Note This assumes that statuscode (and not statecode) is configured in PluginAttributes as the case’s status.

 

Dynamics 365 data is obtained using FetchXML queries, see "Build queries with FetchXML". Queries are created using base and filter queries and are completed using the attributes in the PluginAttributes list. The following base queries have been predefined:

  1. BaseContactQuery:

    <fetch distinct='true' top='100'>

    <entity name='contact'>

    <link-entity name='account' from='accountid' to='parentcustomerid' link-type='outer' alias='account'>

    <link-entity name='contact' from='contactid' to='primarycontactid' link-type='outer' alias='account.owner'>

    </link-entity>

    </link-entity>

    </entity>

    </fetch>

    top is mandatory and linked entities must have an alias.

     

  2. BaseLeadQuery:

    <fetch distinct='true' top='100'>

    <entity name='lead'>

    <link-entity name='owner' from='ownerid' to='ownerid' link-type='outer' alias='account'>

    </link-entity>

    <filter type='and'>

    <condition attribute='statecode' operator='ne' value='1' />

    </filter>

    </entity>

    </fetch>

    top is mandatory and linked entities must have an alias.

    Contacts have precedence over leads. A total of ‘top’ is returned. If there are less contacts, then leads are included until ‘top’ has been reached.

    Only contacts can have cases and the following two settings must be present:

  3. BaseCaseQuery:

    <fetch distinct='true' top='50'>

    <entity name='incident'>

    <order attribute='modifiedon' descending='true' />

    </entity>

    </fetch>

     

  4. ContactCaseFilter:

    <filter type="or">

    <condition attribute="contactid" operator="eq" value="[contactid]" />

    <condition attribute="accountid" operator="eq" value="[account.accountid]" />

    </filter>

    condition attribute and value must be valid SystemName’s.

 

Predefined PluginAttributes

Note These predefined attributes may be overwritten/removed by creating a PluginAttribute item in SharePoint with the same SystemName and Category. Do not give it any field types and set both ShowOnExtensionWindow and ShowOnToast to No to remove this attribute from the query. Also make sure that the system name is not included in any hyperlink!

Note The base query in the PluginSettings list must also be modified when adding attributes of another entity.

Account

DisplayName

SystemName

Order

ShowOnExtensionWindow

FieldTypes

HyperLink

ShowOnToast

Company

companyname

0

No

Name

 

Yes

Account ID

accountid

1

No

Id

 

No

Company

name

2

Yes

Name, Search

 

No

Phone Number

telephone1

3

Yes

PhoneNumber, Search

 

No

Owner

owner.fullname

4

Yes

 

 

No

 

Case

Note {uri.Scheme} and {uri.Host} are only valid for the predefined values by leveraging the ConnectionString. The full URL (with placeholders) is needed when overwriting.

DisplayName

SystemName

Order

ShowOnExtensionWindow

FieldTypes

HyperLink

ShowOnToast

Case ID

incidentid

1

No

Id

{uri.Scheme}://{uri.Host}/m/ef.aspx?etn=incident&id=%7b[incidentid]%7d

No

Title

title

2

Yes

Name, Search

 

No

Description

description

3

Yes

 

 

No

Date

modifiedon

4

Yes

Date

 

No

Status

statecode

5

Yes

FormattedValue

 

No

 

Contact

Note {uri.Scheme} and {uri.Host} are only valid for the predefined values by leveraging the ConnectionString. The full URL (with placeholders) is needed when overwriting.

DisplayName

SystemName

Order

ShowOnExtensionWindow

FieldTypes

HyperLink

ShowOnToast

Contact ID

contactid

1

No

Id

{uri.Scheme}://{uri.Host}/m/ef.aspx?etn=contact&id=%7b[contactid]%7d

No

Account ID

account.accountid

2

No

Id

 

No

Name

fullname

3

No

Name

 

Yes

Email

emailaddress1

10

Yes

Search, Email

 

No

Phone Number

telephone1

20

Yes

Search, PhoneNumber

 

No

Phone Number 2

telephone2

21

Yes

Search, PhoneNumber

 

No

Mobile Number

mobilephone

22

Yes

Search, PhoneNumber

 

No

Company

account.name

30

Yes

Name

 

Yes

Owner

account.owner.fullname

40

Yes

 

 

Yes

Company Phone Number

account.telephone1

45

No

PhoneNumber

 

No

 

Lead

Note {uri.Scheme} and {uri.Host} are only valid for the predefined values by leveraging the ConnectionString. The full URL (with placeholders) is needed when overwriting.

DisplayName

SystemName

Order

ShowOnExtensionWindow

FieldTypes

HyperLink

ShowOnToast

Lead ID

leadid

1

No

Id

{uri.Scheme}://{uri.Host}/m/ef.aspx?etn=lead&id=%7b[leadid]%7d

No

Name

fullname

3

No

Name

 

Yes

Email

emailaddress1

10

Yes

Search, Email

 

No

Phone Number

telephone1

20

Yes

Search, PhoneNumber

 

No

Phone Number 2

telephone2

21

Yes

Search, PhoneNumber

 

No

Mobile Number

mobilephone

22

Yes

Search, PhoneNumber

 

No

Company

companyname

30

Yes

Name

 

Yes

Owner

account.name

40

Yes

 

 

Yes

 

LeadSearch

A copy of Lead, however Name has also received the Search field type.