Uncategorized

Automatically creating Tags via workflow

One of the questions we are often asked is how to automatically Tag records on import/creation. It is really easy to do using the out of the box workflow capabilities in Dynamics 365.

For our example below we are going to use the Description field on the Contact entity as our source of information for processing Tags. We are going to check for two sports that will create Tag connections that will be grouped under our ‘Interests’ parent tag (having a parent tag is not a prerequisite for this process to work). You can add as many conditions as you like to the workflow to create the Tags that you need.

Step 1 – create the workflow

Navigate to Settings > Process Center > Processes and click the New button

Complete the Create Process form. We are using the Contact entity for this example but you can use whichever entity you need to associate the Tags.

ImportTag-CreateProcess

Build out the steps for your workflow as follows:

ImportTag-CreateProcess2

 

For the Create Record step the Set Properties form should look like the following:

ImportTag-CreateProcess3

 

Connect To: Select the Tag record you wish to associate

As this role: Set to Tag

Expand the Details Tab and set the Connected From: in this case it is the Contact record the workflow is running on. If you are using another entity then it should be the record for that entity.

 

Activate the Workflow

 

Step 2 – Import the data or run the workflow on already existing records

Description Field on Contact:

ImportTag-DescriptionField

Tags created after workflow runs:

ImportTag-CreatedTags

Tagging Multiple Records with Multiple Tags in Dynamics CRM

With the latest version of Tagging (download here) we have introduced the ability to tag multiple records with multiple tags all in a single action. This functionality is provided via a new page available in the latest release. Simply select the records you wish to tag and click on the Multi Tag button:

Screen 0 - Multi Tag

Once you click on save the tags are applied to all of the records you originally selected.

Preconfigured Solution

To enable this functionality it requires you to create a button on each grid you wish to utilize multi tagging. To help kick start this for you we have provided a solution that enables this feature on account, contact and cases. Simply navigate to the Tagging page to download a copy of this solution.

Adding a button to the command bar

If you have a custom entity you wish to enable multi tagging on, or you prefer not to use the provided quick start solution, you will want to know how to add a button to the command bar. With the help of a tool called Ribbon Workbench we can easily achieve this.

1. Create a new solution and add the entity you want to customise ensuring you also add the 3 xrmc_ web resources in this screenshot:

Screen 1 - Solution

2. Launch Ribbon Workbench and once it opens select the solution you just created.

Screen 2 - Select Solution

3. Add a command to execute the MultiTag function:

  • Select the entity you with to customise
  • Right click on Commands
  • Click Add New
  • Give the command a name. For example, custom.account.MultiTag.Command

Screen 3 - Command

4. Add a new action to the command

  • Click on the lookup icon to add a new action.
  • Then click on the add button to add a new JavaScript Function Action.
  • The function you will want to call is openMultiTag
  • Select the WebResource called $webresource:xrmc_/MultiTagRibbon.js

Screen 4 - JavaScript Action

5. Add 2 parameters to this function so that it detects what was selected in the grid:

  • Click on the lookup icon beside the parameters box
  • Click the Add button and add a Crm Parameter
  • Set the value to SelectedControlSelectedItemReferences
  • Click the Add button and add another Crm Parameter
  • Set the value to SelectedEntityTypeName

Screen 5 - JavaScript Parameters

6. Add an enable rule to the command. MultiTag is only relevant if you have selected at least 1 record.

  • Click on the lookup icon beside the Enable Rules
  • Click on + Add New
  • Give it a name. For example, custom.account.MultiTag.EnableRule

Screen 6 - Enable Rule

7. Create a step for the rule

  • Click on Add Step and add Selection Count Rule
  • Set AppliesTo to Selected Entity
  • Set Minimum to 1

Screen 7 - Enable Rule Step

8. Now we can move on to the button itself.

  • Click on OK to save everything until you get back to the main screen.
  • To add a button simply drag a button from the toolbox on the left onto the appropriate command bar.

Screen 8 - Button drag

9. Give the button a name, for example, custom.account.MultiTagButton, and set the button properties as per the following settings:

Screen 9 - Button properties

Publish your changes by publishing the solution you have just edited. Note: if your changes don’t appear right away publish the solution again and refresh your browser window.