CRM 2013 Plug-in Regsitration Tool Fails to Connect – IFD

MS Dynamics CRM 2013/15 Plug-in Regsitration Tool Fails to create a connection to an IFD – Error “404”

Recently I came up against an issue where the CRM 2013/2015 Plug-in registration tool from the CRM SDK couldn’t connect to an IFD CRM instance – throwing a “404” exception even though I knew I was using the correct connection details and credentials. I need to turn off some plug-in steps whilst data was updated.

Previously I had been able to connect to the test instance which was also internet facing and the application was available both internally and externally.

Well, one thing you can check (which thankfully worked for me)  was to check the “ActiveMexEndpoint’ for the Federation Provider in the MSCRM_Config database.

STEP 1 – Log into SQL Server Management studio on the SQL server used by the CRM instance in question.

STEP 2 – Navigate to the MSCRM_CONFIG database and then “dbo.FederationProvider”

STEP 3 – Run one of the stored jobs to “Select Top 1000” records, the script executed should read;

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [ActiveEndpoint]
,[ActiveMexEndpoint]
,[Enabled]
,[Id]
,[IdentityClaim]
,[MetadataUri]
,[Name]
,[PassiveEndpoint]
,[RelyingPartyActiveIdentifier]
,[RelyingPartyPassiveIdentifier]
,[IsDeleted]
FROM [MSCRM_CONFIG].[dbo].[FederationProvider]

STEP 4 – Check the value stored for ActiveMexEndpoint, there should be more than one line returned, the value should look like this – https://sts.<yourdomain>/adfs/services/trust/mex if it doesn’t, then that’s your problem. You can execute a script like the following to update them;

UPDATE [MSCRM_CONFIG].[dbo].[FederationProvider] SET ActiveMexEndpoint = ‘https://sts.<yourdomain>/adfs/services/trust/mex&#8217;
WHERE ActiveMexEndpoint = ‘https://sts.<yourdomain&gt://adfs/ls/mex&#8217;

STEP 5 – Once the update has run perform an IIS Reset (cmd > iisreset) on the CRM Server and the ADFS Server and try to reconnect. It is also worth checking that access to the CRM instance externally is functioning as expected.

You should now be able to establish a connection from the CRM Plug-in Registration Tool and register/deactivate your plug-in steps.

NOTE: The production instance had been created from a database backup of test initially as the data was imported from external sources and cleansed – therefore the plug-ins hadn’t been manually registered in the past. Otherwise this issue would have been encountered earlier in the deployment.

Trigger OnLoad Workaround for AJAX issues in CRM 2013

I thought I’d create a quick post as I was required to use a workaround for a client today involving an OnLoad event that wasn’t being called correctly in Microsoft Dynamics CRM 2013.

The background on this is that the AJAX used to refresh the page in CRM 2013 doesn’t necessarily call the OnLoad action, in this case it was affecting the JavaScript used to switch the Account from base on the value “Account Type” option set.

I remembered that a colleague had mentioned this in the past and advised that there was indeed a workaround using configuration, namely;

  • 1 x Boolean field
  • 1 x Synchronous Workflow
  • Update to the fields OnChange event

So what do you do?

Step 1 – Create a new Boolean (Two Option) field for the entity or entities effected. In my client’s case it was Account, using the following steps; Settings > Solutions > Choose Your Solution and Open it > Entities > Account > Fields > New.

Then make sure you add a display name that will make sense to you, set the “Field Requirement” to “Optional” and set the “Type” option to “Two Options”, then click Save and Close.

boolean_triggerfield

Step 2 – Next add the new field to the required forms against your entity, then click “Change Properties” on your field and uncheck “Display Label on the Form” and “Visible by Default” and also check “Lock the Field on the Form” (this will endure admin’ users will have to think twice before removing the field) then click “OK” to close the box. Next click Save and then Publish your changes and close the form (still no button for Save, Publish and Close), repeat for other forms as required.

properties_triggerfield

Step 3 – Create a new Synchronous Workflow (real-time) Process against the entity with “Organisation” as the scope (in this case Account) in CRM that is triggered when;

  • Record is created
  • Record status changes
  • Record fields change (check the required fields to apply this workflow to)

Add a workflow step to update the entity (in this example Account) and in the “View Properties” area select the Boolean we just added and set the field value to “Yes”. Save and Activate the workflow.

Please Note; be careful to select the right option in the “execute as” property, if the owner of the workflow is the system admin’ account then you should have no issues, if it is the user who made the changes, then you will have to consider their security role for the entity.

Step 4 – Finally add the JavaScript from your OnLoad that switches the form etc. to the OnChange event of the new Boolean field in your entity form. You can find this under the field by navigating to; Change Properties > Events > OnChange > Event Handlers > Add.

Remember to add the function in minus “()”. Then click “OK” and Save, Publish and Close. Repeat as required for other forms.

Don’t’ forget to test your changes and you are done.

Using Queues in Microsoft Dynamics CRM

Queues can be instrumental in helping to organise, prioritise, and monitor the progress of your work, such as Cases while you are using Microsoft Dynamics CRM.

If used properly they can act as a centralised location for users to manage case progress, respond to service calls or work with prospects in your sales pipeline. There is often times when the feature is overlooked or misunderstood, however as the functionality was updated around the use of queues in MS Dynamics CRM 2013 SP1 and 2015 there is a lot more to do with queues and it is not as difficult as you may think.

Recently I published a blog post on the use of Routing Rules in CRM 2015 and CRM Online and during the process referenced the Queue entity. So I thought I would expand a little. At a high level what you may or may not know is that queues;

  • Can be used with any custom entity
  • Can be made “Public” or “Private” (with Private queues making the queue items only available to members)
  • Private queues are auto-created for new users or teams when they are created
  • Queues can actually contain multiple entity types, (e.g. tasks, emails, cases)
  • Users can work on Queue Items to prevent task duplication
  • Queues can be workflow enabled
  • Queues cam ne enabled for auditing

Public or Private? In CRM there is an attribute called “QueueViewType” which is used to define if a queue is public or private. Private uses have individual members (users) which are used to allow/remove access to the queue. You can add a team to a private queue and this will add all the team members as members of the private queue. Some other things to remember about queues are that;

  • All user queues are private, so only the user will be able to see queue items in this queue
  • Team queues are marked as private by default, the team owner and all its members have access to the queue
  • All other queues are considered public, anyone with ‘read’ access to queues can see them

For information on CRM queues in previous versions check this MSDN article; https://msdn.microsoft.com/en-us/library/gg328459(v=crm.5).aspx

Creating a Public Queue:

Creating queues are simple enough in CRM, as mentioned above each user account has it’s own private queue created automatically. The ability to create a queue will be based on the users security role, out of the box the following roles can create a queue;

  • Customer Service Manager
  • System Customizer
  • System Administrator

If you have an applicable role with create permissions then you are good to go – if you are not sure you can check your role by using the steps in this Customer Centre article; http://www.microsoft.com/en-us/dynamics/crm-customer-center/view-your-user-profile.aspx

Next go to; Settings > Service Management/Business Management* > Queues, then choose New. You will then need to complete the required fields in the Queue form, out of the box these fields will be;

  • Name
  • Type (Public or Private)
  • Owner (Lookup to System User)
  • Convert Incoming Email To Activities

The “Incoming Email” field is for exactly that purpose, here you can enter the email address that receives all messages for this queue, for example; ‘info@myorganisation.com’.

In the “Convert Incoming Email to Activities” field you will need to make sure you choose the appropriate action, by default this will likely be populated with “All email messages“, this will not be suitable for everyone. Depending on the purpose of the queue you may want to only covert emails that are “Email messages in response to a CRM email” or only emails from Leads, Accounts and Contacts.

The locked field referring to “Mailbox” will be automatically populated with a new mailbox record when you have created the Queue, once this has occurred you can update the mailbox details using the link.

Finally, click Save.

*Service Management will be visible in the Settings area of CRM based on the version you are using.

Queue_Create

Queue Items:

Queue items are displayed in the associated sub-grid within the Queue form. If you are using Cases for your solution then all cases that are either; (a) routed to this queue (using routing rules) or (b) manually assigned cases will be displayed.

It is worth noting that a queue item is automatically deactivated if the associated record is updated from Active to Inactive, which applies as you’d expect to all queue enabled entity records that have Active or Inactive states in CRM.

Create an Automatic Case Creation Rule;

Automatically creating cases from incoming email can be awesome for reducing the amount of manually created cases in CRM and increasing the actual contact time of a support desk and your agents for both internal and external channels. Case creation rules use conditions similar to those found in Advanced Find to automatically convert emails into support cases.

Please Note; This functionality applies to MS Dynamics CRM Online that were either updated to CRM 2013 SP1 (or Spring ’14 release as it is known) or the CRM 2015 product update. If your deployment is On Premise you will also need to have updated to CRM 2013 Sp1 or CRM 2015.

Step 1 – Create a New Record

To create a new Case Creation Rule in CRM 2015 click the “Email to Case Settings” button in the ribbon from your Queue (as created in the above steps). The create window will pop a new Case Creation Rule form, complete the required fields, which include;

  • Name
  • Source Type (Email)
  • Queue (Lookup to your Queue)
  • Owner

Now, you can only associate one rule per source type, so in this example once we have selected the “Source Type” as “Email” in a rule for this queue, we cannot have another active rule associated unless it is used for Social Monitoring. Also, make sure your queue has an email address as per the previous section.

Case_Creation_Rule1

Step 2 – Specify Conditions

Next you will need to go to the “Specify Conditions for Case Creation area in the next section of the form and choose your condition or conditions (as you can add multiple). These include;

  • Create cases for email from unknown senders+
  • Create case if a valid entitlement exists
  • Create cases for activities associated with a resolved case
  • Create case when the case associated with the activity is resolved since

Create Cases for email from unknown senders – if you select this option all emails from unknown senders (i.e. a sender that cannot be associated with an email in a CRM record) are converted to a case, be default this will also create a contact record. However this does work in conjunction with the personal options for “Automatically Create Records” set by the user that owns the rule.

+If this option is not selected cases will only be created automatically for email senders that are attributed to an Account or Contact in CRM, (those email addresses associated to other records will not create a case).

Create case if a valid entitlement exists – if you select this option then the rule will do exactly that, to read more on entitlements see; https://msdn.microsoft.com/en-us/library/dn689025.aspx. If the sender of the email is a contact that has a parent account with a valid entitlement and the contact is associated using the sub-grid on the entitlement, then a case is created, this is also true if the entitlement sub-grid is empty as the entitlement can be applied to all contacts for that account.

Create cases for activities associated with a resolved case – a case will be created if the email is related to a resolved case if it references an active case then no case is created. If you select this option then the option for Create case when the case associated with the activity is resolved since appears which allows you to select/define a duration. This will mean that a new case will be created only if it is resolved earlier than the specified duration. If it is later then it is associated with the existing resolved case.

When you are done click “Save”.

Step 3 – Specify Case Details

Now we need to add conditions for the creation rule, for those users familiar with Advanced Find it is as easy as that. We also need to add the case properties for the records we are going to work with once created, such as the priority etc.

In this step you can define how to treat cases based on their customer category or the contact type, a good tip is to be sure that you use the correct reference in the conditions, for example, for Contacts it is; “Sender (Contact)”, for Accounts the reference is; “Senders Account(Account)”. You add conditions by clicking the “+” icon near for “Condition”.

Case_condtitions

Once you are done click “Save” and if you are happy click “Activate”.

Please Note; Once a case is created the incoming email is removed for your Queue. If there are no routing rules to apply to the newly created case to a user or Queue then the case owner will be set to the user that owns the case creation rule.

Hope this helps, if you need to dig deeper check out the CRM Customer Centre, or for technical information such as case creation from a web service see MSDN. Happy CRM’ing!

Dynamics CRM Activity Timeline via xRM Consultancy

Since the upgrade to Microsoft Dynamics CRM 2013 administrators have been able to use the conversations tab to allow users to view related activities, notes and posts against their associated records, essentially replacing the activity and history tabs from previous versions. The conversations tab displays a chronological list of the activities that are either open or completed using the current CRM look and feel, however scrolling through this list for records such as accounts with a high volume of activities to those that are yet to be completed is not very user friendly.

One solution is to use the Timeline for Microsoft Dynamics CRM from xRM Consultancy to provide a visual representation of the future and historical interactions related to the entity in your CRM instance. Recently I have found this a useful addition to clients’ CRM deployments.

The solution can be applied to CRM Online and On Premise deployments and is compatible with CRM 2015 as well as 2013 and 2011, the solution is free if you are looking to apply it to the following entities:

  • Account
  • Contact
  • Opportunity

The timeline is pre-configured to use the following default entities to display:

  • Appointment
  • Email
  • Fax
  • Letter
  • Case
  • Phone Call
  • Task
  • Service Task
  • Opportunity
  • Campaign Response

As part of the free version you can manage which of these entities are displayed too, I will cover that later on.

For the walkthrough we will use the free version, you can purchase the full version to enable against custom entities from their website, (pricing at the time of writing is “Less than 50 active users” = 995.00 GBP/ $1935.65 NZ or “More than 50 active users” = 1995.00 GBP/ $3881.03 NZ).

Step 1 – Download & Import the Solution

You can download the managed solution from the xRM Consultancy website, or by using the following link: http://www.xrmconsultancy.com/what-we-do/microsoft-dynamics-crm-timeline/

xrm_download

You will be required to enter your name and email address and select the version of CRM you want the solution to be compatible with (in this examples CRM 203/2015) and then click “Send”. You will then see an alert asking you to click on the newly presented link. Click the link and the download will begin.

Once the download has completed navigate to your CRM instance and import the solution via; Settings > Solutions > Import. And follow the usual steps to complete.

Please Note: As this is a managed solution once you have imported into CRM removing the solution will remove all installed components, however you will still want to use a non-production instance first to assess the suitability of the customisations for your deployment.

Step 2 – Timeline Configuration

Once you have imported the solution you’ll need to open it in CRM and accept the terms& conditions of use as per below. You will then see a link to “Open Timeline Configuration”, click the link to launch the pop-up window.

xrm_config1

In the Timeline Configuration window you will see the “Timeline Entities” displayed in a sub-grid, here you can remove entities that you do not want to display in the timeline, (if you have entities in this list that are not in use or viewable to users you may encounter errors so it is best to check). Additionally you can open one of the associated entities to view/amend the settings and the query used (amendments are via the paid version only).

xrm_entity

Step 3 – Entity Configuration

Next you will need to add the timeline to your entity, for this you can use a new or existing unmanaged solution. Open the entities form (in this example I am using Account) and insert a new tab or section.

Then in the form editor go to; Insert > Web Resource > search for and select “xrmc_Timeline.html” > Add a Name > Add a Label > Ok, this will add the HTML component from the managed solution. You can then alter the amount of space you require for the timeline using the formatting options.

xrm_webres

If you have added the timeline to a new tab, you may want to collapse the tab as default depending on the amount of processing required for your form OnLoad. Then save and publish your changes.

Step 4 – Assign Custom Security Roles

In order for users to view or work with the timeline you will need to assign them one of the custom roles imported as part of the managed solution. “Timeline Writer” allows users to add the timelines to forms and change the configuration (version permitting), the other role “Timeline Reader” will enable them to view the HTML component we have just added to the Account record.

xrm_roles

Navigate to the “Administration” or “Security” area of CRM, depending on your version and assign the security role to your users and/or teams as required.

Once you have completed your set up navigate to see your changes. You can click on activities in the timeline to view the details or scroll up and down the timeline with your mouse/finger.

xrm_account

This can be a great addition to your configuration and add to the overall user experience in CRM. Enjoy!