Adding Custom Fields to Playbook Activities

As mentioned in my previous post on the new Playbooks feature in Dynamics 365, I’ve been waiting for this functionality as we needed it for a current project. We already worked out how to automate the creation of playbooks, but we needed more (as is always the case!).

As we’ve been developing our solution with Playbooks over the last 2 weeks, we’ve wanted to set additional fields on the resulting activities, but with the create form of the activities on a playbook being quite locked down, there was no way to add additional fields to it.

Quick Create Paybook Activity

Going for a dig into the entities that are in the playbook solution pointed me to the Playbook activity attribute entity. This entity is basically a key/value pair of attributes and values that are related to the Playbook activity record.

Playbook Activity Attribute advanced find

To visualise these entities it may help to have a simple relationship diagram. A pllaybook template can have 1 or many playbook activities, and a playbook activity has many activity attributes. The out of the box playbook activity creation process adds playbook activity attribute records for each field in the create form.

Playbook entity relationships

I was hoping by adding a record to this entity it would set the value on the resulting activitiy. Creating a new record from the advanced find screen opened the entity form with only one field on it. This means that we need to edit the form and add the fields on it we need. Thankfully this form is an unmanaged form which allows us to add it to a solution and edit as we need. The original form is below.

Playbook Activity Attribute base form

And then after adding the fields on it that we needed, it looks like this.

Playbook Activity Attribute updated form

Now when we add a record to the entity we can set the values we need.

The critical component in this is to ensure the Attribute Name is set to the Internal name (not the display name) of the field on the activity you want to set, and it has the same attribute/data type. In my example, I have a Sales Stage option set field on the Task activity that I want to set, so I use the below values in the Playbook Activity Attribute record.

Sales Stage field on activity

Here is the Playbook activity attribute record. Note the name, value and type match the field on the phone call entity. Select the appropriate Playbook activity record in the Playbook activity ID field. You can make sure you have the right one by checking the Subject of the activity in the playbook template.

Qualify Sales Stage Attribute.jpg

You may need to also publish the Playbook template as the Playbook activity attribute has a Draft/Published status.

Publish Playbook template

Now, when we add the Playbook to an opportunity (either automatically or manually), the activity that is created has the Sales Stage set inside it.

Stage set on activity

While it would have been great if this functionality was included out of the box with Playbooks, I’m glad its easy enough to add this using some simple config.

Good luck with your playbook adventure!

Advertisements

Automating Dynamics 365 Playbooks

In the October 2018 (v9.1) release of Dynamics 365, there is new functionality in the Sales App called Playbooks. Have a read of the Microsoft documentation and Jukka Niiranen’s blog post for an understanding of what they can do.

The standard functionality to launch a playbook is to create it from a button on the ribbon. While this is fine in some scenarios, my current project needs to have a defined set of activities assigned to the Opportunity owner when the Opportunity reaches certain stages. So I wanted to automate the creation of the Playbook and it seems you can do this through workflow.

I’m going to assume you have already created a Playbook Template, associated it to a entity, setup your activities and published it. From this point, create a new workflow on the entity you wish to create the Playbook from, in my case thats the Opportunity, as I want to trigger it from the stage changes in the Business Process Flow.

The key to the workflow is to create a Playbook record. The settings that I have used are below. Make sure you set the Regarding field to the current Opportunity and select the Playbook template and Category. Also, so the activities get created with the Regarding field set to the Opportunity, ensure you set Track Progress to No (there is an explanation of this in Jukka’s post).

Create Playbook Record

My workflow for this purpose is pretty simple, as I just want to create the Playbook. So I can use it in the BPF, I have it set to run on demand. If you wanted to use another trigger to create your playbook you could use other workflow start settings.

Opportunity-Develop Playbook Workflow

Once you have activated your workflow, edit the BPF to add this workflow to run on the stage change. I used Stage Entry to the Develop Stage (in the OOTB Lead to Opportunity Sales Process).

Lead to Opp BPF with Workflow.jpg

Once the BPF changes have been validated and activated, its time to test this out. For my example, I need to create and qualify a Lead, which will result in my Playbook Template activities being created on the qualified Opportunity.

Opportunity with Playbook Activities.jpg

I think this is a great outcome. I was expecting this functionality to be built in to the Playbook Template itself, but at least there is an easy enough workaround using Workflow.

Using Outlook Actionable messages with Dynamics 365

Recently I came across a feature of Outlook called Actionable Messages. The best way to think about these are complex message templates which allow you to embed functions, actions and formatting inside an Outlook email. This gives you the ability to perform actions from within Outlook rather than just having a notification of something and then having to go to another system to perform the action. These actions could performing a Task Approval, providing a comment on an issue or set a due date on a Trello card. Technically, these actions are HttpPost requests which you can develop your own actions from.

In addition to this I was recently reminded by a couple of good friends about how powerful a daily digest email we had built to send us project status updates each morning. We did this originally using SharePoint and Project Online as a source and then Nintex Workflow as the process engine and email sending. I used this example as a way to learn about Actionable Messages, use Dynamics 365 as the source of the information and to use Microsoft Flow again (which I always enjoy!). The end goal of this will be to produce an email that gets sent each day that shows a nicely formatted list of new Leads that have been created in Dynamics 365. Something like the below.

LeadDigest-2

The first thing we have to do is define our actionable message template. You can read all about them here. Essentially you can use a Sandbox system to develop the message template (its in JSON) and get the layout and actions configured. The MessageCard Playground helps with this. The layout that I’ve gone for is as follows.

{
	"@type": "MessageCard",
	"@context": "http://schema.org/extensions",
	"summary": "New Leads created Yesterday",
	"themeColor": "0078D7",
	"sections": [
		{
			"activityTitle": "Fullname",
			"activitySubtitle": "CompanyName",
			"activityText": "Subject",
			"facts": [
                { "name": "Estimated Budget:", "value": "budgetamount" },
                { "name": "Customer Need:", "value": "description" },
                { "name": "Owner", "value": "owner" }
            ]
		},
		{

			"potentialAction": [
				{
					"@type": "OpenUri",
					"name": "View lead",
					"targets": [
						{ "os": "default", "uri": "recordurl" }
					]
				}
			]
		},
		{
			"activityTitle": "Fullname",
			"activitySubtitle": "CompanyName",
			"activityText": "Subject",
			"facts": [
                { "name": "Estimated Budget:", "value": "budgetamount" },
                { "name": "Customer Need:", "value": "description" },
                { "name": "Owner", "value": "owner" }
            ]
		},
		{

			"potentialAction": [
				{
					"@type": "OpenUri",
					"name": "View lead",
					"targets": [
						{ "os": "default", "uri": "recordurl" }
					]
				}
			]
		}
	]
}

This template lays out the text in a way which shows the basic details of the Lead and also allow the person viewing the lead to go directly to the lead form for the record. The info available on the options and syntax of the message templates is available at https://docs.microsoft.com/en-us/outlook/actionable-messages/card-reference, I’m not going to explain everything, we’ve got heaps more to cover!

Now on to the Flow. Below is the overall view of the flow we’ll be creating.

Flow Overview.png

In essence the flow sets up some variables, queries D365 for Leads created today, then loops through the Leads and applies the data from the lead into the appropriate section of the message template. It then finalises the template and then sends the email. I did have to do a few tricky parts though so I’ll call them out below.

To query for Leads created today you need to use an OData query for this. The correct format for checking for dates using D365 Query Functions is Microsoft.Dynamics.CRM.Today(PropertyName=’createdon’).

The main part of the flow adds in the Lead data into Section for the template. That looks a little like the below.

FillSection

Due to needing to format the JSON correctly for the message template requires us to fill in the data for the section and then append it to the DigestJson. To do this properly means we need to perform some slightly different formatting the first time through the loop compared to each subsequent loop. I did this using a Condition that identifies the first time through the loop.

Flow Condition

The part that stumped me the most in the flow is that when you set the value of a variable, you can’t self reference the variable. Normally if you want to append a value to the end of an existing variable you would add the new value to the end of the existing variable and save it back into itself. To get around this I had to be a little creative in using multiple variables to achieve what I needed to.

Lastly, you need to apply some final formatting to the message template so it can be included in an email to send. This includes some <script> tags and also needing to go through a small amount of registration at the Actionable Message Developer Dashboard. This ends up giving you a provider code that you need to apply so the email actually sends properly. If you needed to use this in a production environment you would need to go through an approval process which starts at the Developer Dashboard.

I hope this has helped you out and given you some ideas on what you can do with Actionable Messages, Flow and Dynamics 365. I would like to try extending this message to include the ability to reassign leads to another sales person and to also add an approve/reject function which updates the status on the lead. If I do that I’ll post up another blog post.

Rename Dynamics 365 Entities

Having to rename entities in Dynamics 365 for Customer Engagement is a pretty common scenario. This might mean you need to change the Account entity to Company, or Contacts to Customers or Opportunity to Sale. On the surface, its very easy to change the entity name in the entity configuration screen, but this only changes the display name of the entity in the menu, it doesn’t change any of the forms, views, descriptions, error messages or many of the other places the entity name exists. You could go through and do this manually but it would take hours.

The following method is an easy (and fast) way to change this. This method has been around for a long time, I initially came across it about 5 years ago, but the original blog post has been removed and I struggled to find a good step by step process to do it. There are a couple of gotcha’s if you do things the wrong way so take note.

The basic steps of this method are as follows:

  • Rename the entity in the entity configuration screen
  • Export the Translations file from a solution
  • Open the Translations file in Excel and use find/replace to update each instance of the entity name (including plurals and upper/lower case)
  • Import the translation file to D365

In the below process I’m going to update the Contact entity to Customer.

Rename the entity in CRM

  • Go to your solution and open up the main config page for the entity
  • Update the Display Name and Plural Name to the new names
  • Save and Publish your changes

CustomerRename

Export Translations

This can be done through either the standard web interface or through XRM Toolbox. I’m going to go with the standard interface.

  • Browse to your solution (ensuring that the entity you want to change is included in your solution).
  • Click the Translations drop down in the top menu of the window and click on “Export Translations”

ExportTranslations

  • Open the downloaded .zip file and extract out the two files to a folder
  • Open the CrmTranslations.xml file in Excel

Edit the CrmTranslations file

  • Once the file is open in Excel, you will need to Enable Editing and Unprotect the sheet (in the Review Tab, Unprotect Sheet button)
  • You’ll note there are three sheets, Information, Display Strings and Localized Labels. We need to update the Display Strings and Localized Labels sheets.
  • Using Find/Replace, only on column C (if you update any of the coloured columns you won’t be able to import the file), update each instance of the entity name to the new name, specifically for my example.
    • Highlight the whole of column C
    • Click on Find and Select in the ribbon then Replace (or press Ctrl-H)
    • Open Options on the Replace window and ensure that Match Case is ticked
  • Complete the following Find/Replaces, in the order (the screenshot shows the correct settings). You need to replace the plural names first and then the singular names. Not doing it in this way may cause issues replacing a singular word with its plural (or vice versa).FindReplaceExample.png
    • Find – Contacts, Replace with – Customers – 9 replacements
    • Find – contacts, Replace with – customers – 24 replacements
    • Find – Contact, Replace with – Customer – 13 replacements
    • Find – contact, Replace with – customer – 63 replacements
  • Change to the Localized Labels sheet (unprotect it), highlight column D and perform the same set of find/replace in the same order
    • Find – Contacts, Replace with – Customers – 29 replacements
    • Find – contacts, Replace with – customers – 38 replacements
    • Find – Contact, Replace with – Customer – 13 replacements
    • Find – contact, Replace with – customer – 151 replacements
  • Save the file, ensuring the format is kept the same (.xml). Ignore the message that Excel gives that you may lose information etc.

Import Translation File

  • D365 expects the translation file to be in the same format as the exported file, so make a new .zip file with the updated CrmTranslations.xml file and the unchanged [Content_Types].xml file. The name of the zipped file doesn’t matter
  • In your solution, click on Translations > Import
  • Choose your .zip file in the dialog that appears and click Import

TranslationImport.png

  • You should get a message indicating that the Translations have imported successfully. If you haven’t you’ve likely edited a value in one of the reserved columns in the file.
  • Publish All Customizations and then review the entity and the rest of D365 to see if all of the names have changed. Make sure you press Ctrl-F5 to refresh the page so you pick up all of the major changes. Form names, view names, descriptions and many other things have now been updated.

CustomerFormList

CustomerViews

I hope this has made it easier to fully rename an entity in D365 in all of the places that you need to so you can have a complete solution.

 

 

CRM Deployment

CRM 2013 SP1 (Online Spring ‘14 update) introduced the Package Deployer. I initially came across this when I installed the CRM Unified Service Desk and at the time didn’t really see the value in it. My current project has now certainly changed my mind, I’m a huge fan. In SharePoint land we have been using automated deployment through PowerShell for a year or so now and it changes your mind about how easy deploying a solution can be. In the CRM world, until now, we didn’t have the possibility of any kind of automated deployment (that I know about anyway).

Firstly let me describe the end product, so you can understand the value in going through the following steps.

You have a client with 2-3 environments (Dev, Test, Prod) and at the start of the project you create your solution file, add the OOTB entities to it, make some changes, create a whole lot of reference entities and import your clients data into them. You also need a few other solutions, maybe a Country code listing, Ribbon Workbench etc. To move between the environments you previously needed to (well this was the way I did it):

  • Export all the solutions
  • Export all of your reference data into spreadsheets
  • Take note of a few different settings that you can’t migrate
  • Import the solutions in the right order
  • Configure any other settings
  • Import in the reference data using maps that you create during import

If you have multiple environments or need to go through multiple iterations it becomes incredibly painful, inefficient, error prone and a bad experience for all involved.

Using the Package Deployment methodology you can now export the solution files, extract reference data, add them to a package file using Visual Studio (don’t run away functional consultants, this is for you too!). Then easily deploy the files into an environment in a matter of minutes.

OK, how do we do all of this? As is normal for new stuff the info comes from a few places, hence why this post has been written so you have it all in one place.

Environment Configuration

You’ll need Visual Studio 2012, 2013 or 2015 with the CRM projects (maybe you could use the new Community edition if you don’t have a license) and the CRM 2015/2016 SDK.

Extract the SDK to an easy to get to location (I use C:\CRM).

Extract Configuration Data

In the SDK, you’ll find the ConfigurationMigration tool (in C:\CRM\SDK\Tools\ConfigurationMigration). Run the DataMigrationUtility.exe file and use the “Create Schema” option. You will get to the following screen after logging in to your CRM environment.

Schema1

This screen allows you to choose the entities you want to extract and the fields you need. Choose the right solution that has your entities, select each entity you need and then either go through and just select the fields you need to extract or click the Add Entity>> button. After selection you should end up with something similar to the below.

Schema2

Click on the Save and Export button. Save the generated XML file somewhere safe. If you are ready to Export the data, click Yes on the pop up.

Export1

In this screen you’ll need to choose a file name and location to save the extracted data. Once that’s done, click on the Export Data button.

This will then do some checks and give you the number of records that have been extracted.

Export2

You can exit and close this application once you are done.

Package Creation

In Visual Studio you’ll need the right Project Templates to start this, so double click on the visx file you downloaded earlier from https://visualstudiogallery.msdn.microsoft.com/c1eff934-bf97-40a6-bbe3-c25178f18f86.

Start up Visual Studio and create a new Project and use the CRM Package in the CRM SDK Templates group

CreateProject

This project has the following structure.

ProjectStructure

  • PkgFolder is the location you add your .zip solution and data files and the schema file that was generated from the Configuration Migration tool.
  • The Default.htm files in the EndHtml and WelcomeHtml folders are used to display information about the package. You can edit these files. I added in detail of the entities and modules that were being deployed in this deployment
  • ImportConfig.xml is the file thats used to define what gets imported in the deployment.
  • PackageTemplate.cs is a C# file you can edit to define some properties (if you rename the PkgFolder name you must define the new name in this file), there are properties for Long/Short package names and a description. You can also define pre and post deployment steps in this through code….way over my head though. Details on this are at http://msdn.microsoft.com/en-us/library/dn688182.aspx#Step5

To add files to the PkgFolder, just right click on it and select Add>Existing Item and choose the .zip solution files, .zip data file and .xml schema files that you got from the Configuration Migration tool. IMPORTANT, you need to set the “copy to output directory” property for each file to “Copy always”.

PkgFolder

Open up the ImportConfig.xml file and we can start adding info to it. I removed the whole <filestoimport> element as in my situation I don’t need it. If you used standard csv or xml files and an import map then you need to specify them in here, but as we are using the extract from the Configuration Manager tool you can remove the whole element.

  • Add additional <configsolutionfile solutionpackagefilename=”Phase1Configuration_0_1.zip” /> elements for each of your solution files.
  • Put in the filename of the data extract into the crmmigdataimportfile attribute.
  • Eventually your ImportConfig.xml file should look similar to this.

ConfigXML

You can get a definition of this file schema from http://msdn.microsoft.com/en-us/library/dn688182.aspx#Step4.

Once you have got to this point you can now Build your solution which will create a .dll and the PkgFolder in the Debug folder in your solution folders (Projects\TestCRMPackage\TestCRMPackage\bin\Debug). Copy the PkgFolder and the solutionName.dll file to the clipboard.

Package Deployer

Now comes the interesting part, actual deployment!

The .dll and PkgFolder you copied previously should be now copied directly into the PackageDeployer folder in the SDK Tools folder (C:\CRM\SDK\Tools\PackageDeployer). This actually differs from what the MSDN article says, its wrong, you just need the .dll and the PkgFolder with all of your assets in it, if you do what the MSDN article says (located at http://technet.microsoft.com/en-us/library/dn647420.aspx) you’ll get an error stating that there are no Packages to deploy.

Run the PackageDeployer.exe file and it should pick up the package you copied in. Connect to your CRM instance and then click Login. You should then see the WelcomeHtml default.htm file. If you modified it within the VS solution you should see your changes in it. Below is the default one.

HTMLStart

On the next screen, if you have multiple packages you can then choose which package you want to deploy to which CRM organisation. If you have forgotten to set the Copy to Output Directory property on any files, you’ll probably get an error here. If you do, go back into VS, set the property on any files, then build you solution and copy the folder and .dll into the PackageDeployer folder again. Once you get no errors, just click through Next, Next and finally you’ll see the solutions and data being imported. Once its completed you’ll then see the EndHtml default.htm file. 

You can also perform the deployment via PowerShell, the (simple) script below can be used to perform this. You must load and run this script from the PowerShell folder in the PackageDeployer folder. The script can be run by typing the below from a admin PowerShell window.

.\Deploy-CRMPackage.ps1 –crmUrl “https://crmserver.company.com.au/” –orgName OrgToImportTo –packDir “c:\crm\SDK\PackageDeployer” –packName packageName.dll

Param(
  [string]$crmUrl,
  [string]$orgName,
  [string]$packDir,
  [string]$packName
 )
 Write-Host "Running XRMTooling script" -foregroundcolor Green;
 & "C:\CRM TOOLS\PackageDeployer\PowerShell\RegisterXRMTooling.ps1";
 Add-PSSnapin Microsoft.Xrm.Tooling.Connector;
 Add-PSSnapin Microsoft.Xrm.Tooling.PackageDeployment;
 Write-Host "Getting credentials for CRM" -foregroundcolor Green;
 $Cred = Get-Credential;
 Write-Host "Importing Package" -foregroundcolor Green;
 $CRMConn = Get-CrmConnection -ServerUrl $crmUrl -OrganizationName $orgName -Credential $Cred;
 Import-CrmPackage –CrmConnection $CRMConn –PackageDirectory $packDir –PackageName $packName -Verbose;
 Write-Host "Package Deployed" -foregroundcolor Green;

There you have it. Hopefully by following these directions you have simplified your deployment and become more efficient in your deployment between environments.

CRM 2015 and the Site Map

I’m on a project to implement CRM and we have decided to upgrade to CRM 2015. All development so far (mostly config based) has been in CRM 2013 and is included in one Unmanaged Solution. This solution includes entities, processes and a customised Site Map. The Site Map in CRM 2015 has changed, especially in the Settings area to include a new Group called Security. This new group includes links to Users and Security Roles.

If you import a solution from CRM 2013 to CRM 2015 (or I guess import a CRM 2013 database into CRM 2015) which includes a customised Site Map, you will override the Settings area which will mean you can no longer get to the Users or Security Role entities. The only way to fix this is to copy in the new CRM 2015 Settings area into your customised Site Map.

I’ve copied a default Settings area below as I was unable to find a copy of a default CRM 2015 site map online. You will need line 19 out of the below XML and place it somewhere in the “System_Setting” Group.

Hope this helps someone else out.

  <Area Id="Settings" ResourceId="Area_Settings" ShowGroups="true" Icon="/_imgs/settings_24x24.gif" DescriptionResourceId="Settings_Area_Description" IntroducedVersion="7.0.0.0">
 <Group Id="Business_Setting" ResourceId="Menu_Label_Business" DescriptionResourceId="Menu_Label_Business" IntroducedVersion="7.0.0.0">
 <SubArea Id="nav_businessmanagement" ResourceId="Homepage_BusinessManagement" DescriptionResourceId="BizManagement_SubArea_Description" Icon="/_imgs/ico_18_busmanagement.gif" Url="/tools/business/business.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_template" ResourceId="Homepage_Template" DescriptionResourceId="Template_SubArea_Description" Icon="/_imgs/ico_18_templates.gif" Url="/tools/templates/templates.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_productcatalog" ResourceId="Homepage_ProductCatalog" DescriptionResourceId="ProductCatalog_SubArea_Description" Icon="/_imgs/ico_18_productcatalog.gif" Url="/tools/productcatalog/productcatalog.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0">
 <Privilege Entity="product" Privilege="Read" />
 </SubArea>
 <SubArea Id="nav_servicemanagement" ResourceId="Homepage_ServiceManagement" DescriptionResourceId="ServiceManagement_SubArea_Description" Url="/tools/servicemanagement/servicemanagement.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 </Group>
 <Group Id="Customizations" ResourceId="Homepage_SystemCustomization" DescriptionResourceId="Homepage_SystemCustomization" IntroducedVersion="7.0.0.0">
 <SubArea Id="nav_syscust" ResourceId="Menu_Label_Customizations" DescriptionResourceId="Customization_SubArea_Description" Icon="/_imgs/area/18_syscust.gif" Url="/tools/systemcustomization/systemcustomization.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_solution" Entity="solution" ResourceId="Web.Tools.Solution.map_xml.aspx_1" AvailableOffline="false" GetStartedPanePath="Solutions_Web_Admin_Visor.html" GetStartedPanePathAdmin="Solutions_Web_Admin_Visor.html" GetStartedPanePathOutlook="Solutions_Outlook_Admin_Visor.html" GetStartedPanePathAdminOutlook="Solutions_Outlook_Admin_Visor.html" DescriptionResourceId="Web.Tools.Solution.map_xml.aspx_2" Url="/tools/Solution/home_solution.aspx?etc=7100" IntroducedVersion="7.0.0.0">
 <Privilege Entity="solution" Privilege="Read" />
 </SubArea>
 <SubArea Id="nav_marketplace" ResourceId="Homepage_Marketplace" DescriptionResourceId="Marketplace_SubArea_Description" Icon="/_imgs/SystemCustomization/ico_18_marketplace.png" Url="/tools/SystemCustomization/SolutionsMarketplace/SolutionsMarketplace.aspx" Client="Web" IntroducedVersion="7.0.0.0" />
 </Group>
 <Group Id="System_Setting" ResourceId="Menu_Label_System" DescriptionResourceId="Menu_Label_System" IntroducedVersion="7.0.0.0">
 <SubArea Id="nav_administration" ResourceId="Homepage_Administration" DescriptionResourceId="Administration_SubArea_Description" Icon="/_imgs/ico_18_administration.gif" Url="/tools/Admin/admin.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_security" ResourceId="AdminSecurity_SubArea_Title" DescriptionResourceId="AdminSecurity_SubArea_Description" Icon="/_imgs/area/Security_32.png" Url="/tools/AdminSecurity/adminsecurity_area.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_datamanagement" ResourceId="Homepage_DataManagement" DescriptionResourceId="DataManagement_SubArea_Description" Icon="/_imgs/ico_18_datamanagement.gif" Url="/tools/DataManagement/datamanagement.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_systemjobs" ResourceId="Homepage_SystemJobs" DescriptionResourceId="SystemJobs_SubArea_Description" Entity="asyncoperation" Url="/tools/business/home_asyncoperation.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_documentmanagement" ResourceId="DocumentManagement.SettingsArea.Heading" DescriptionResourceId="DocumentManagement.SettingsArea.Description" Icon="/_imgs/DocumentManagement_16.png" Url="/tools/documentmanagement/documentmanagement.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0">
 <Privilege Entity="sharepointsite" Privilege="Read" />
 <Privilege Entity="sharepointdocumentlocation" Privilege="Read" />
 </SubArea>
 <SubArea Id="nav_audit" ResourceId="Audit_SubArea_Title" DescriptionResourceId="Audit_SubArea_Description" Icon="/_imgs/area/16_audit.png" Url="/tools/audit/audit_area.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="nav_social" ResourceId="Social_SubArea_Title" DescriptionResourceId="Social_SubArea_Description" Icon="/_imgs/area/16_social.png" Url="/tools/social/social_area.aspx" AvailableOffline="false" IntroducedVersion="7.0.0.0" />
 <SubArea Id="msdyn_postconfig" ResourceId="Activity_Feed_Configuration" Entity="msdyn_postconfig" IntroducedVersion="7.0.0.0" />
 <SubArea Id="msdyn_postruleconfig" ResourceId="Activity_Feed_Rules_Configuration" Entity="msdyn_postruleconfig" IntroducedVersion="7.0.0.0" />
 </Group>
 <Group Id="ProcessCenter" ResourceId="Menu_Label_ProcessCenter" DescriptionResourceId="Menu_Label_ProcessCenter" IntroducedVersion="7.0.0.0">
 <SubArea Id="nav_workflow" Entity="workflow" DescriptionResourceId="Workflow_SubArea_Description" AvailableOffline="false" GetStartedPanePath="Workflows_Web_User_Visor.html" GetStartedPanePathAdmin="Workflows_Web_Admin_Visor.html" GetStartedPanePathOutlook="Workflows_Outlook_User_Visor.html" GetStartedPanePathAdminOutlook="Workflows_Outlook_Admin_Visor.html" IntroducedVersion="7.0.0.0" />
 </Group>
 <Group Id="Extensions" ResourceId="Group_Extensions"></Group>
 </Area>

Documenting InfoPath Rules

As a guy who spends too much time in InfoPath I am continually trying to make my life easier. When it comes to documentation of projects, our clients typically don’t need the settings on every single rule on a form, but I do like to add detail about specific rules that are complex or critical. In the past I have manually typed out the settings in each rule, including Conditions and Rule actions, in large forms with lots of rules, this gets pretty frustrating and wastes a lot of time.

I’ve just come across a much easier way to do this and thought I should share it with you all (well, the three people that read my posts!). This method uses a combination of screen clipper and OneNote to grab the text from a screenshot and then paste it into a document.

The form I’ll be using has heaps of complex rules in it that I need to document, so lets start.

  • Bring up the rule that you want to document and use screen clipper (WinKey + S should be the shortcut if you use OneNote too), you’ll get something like the below.

image

  • Paste this image into OneNote, then right click on it and select the “Copy Text from Picture Option”

image

  • You’ll then have all of the text in your clipboard, thankfully formatted using Courier New, as per the below (this is a direct past from the above picture, I’ve just removed some line space)
Query using a data connection: GetUserProfileByName

Set a fields value: RequestorName = Value[Name = PreferredName]
Set a fields value: RequestorPosition = Value[Name = SPS-JobTitle]
Set a fields value: RequestorPhoneNumber = Value[Name = WorkPhone]
  • As you can see, this is a pretty close match to the rule in the screenshot!! Pretty awesome. There have been a couple of things which I’ve needed to clean up (normally {} or []), but generally, its so close to the actual text its a non-issue.

Obviously this text copy function can be used for heaps of other things, but it has saved me hours of documentation for this project (and no doubt others!).

As an additional point, make sure you check out the Rules Inspector (in the Data Tab in InfoPath 2010 or 2013), it lists the detail of every Default Value and Rule that exists in your form. In my experience it doesn’t paste in anywhere near as well as the above example but does still work. There also seems to be a bug in the Rules Inspector that it will show an error if you have any issue with any rule in your form.

As always, hope this helps you out!