How can I work out the time spent in each stage of a business process?

Business Problem: I want to know how long is spent in my business process by stage and by user how can I achieve this with no code?

The solution is actually quite simple if you are the latest release of Dynamics 365. The key to the solution is the fact that Dynamics now maintains the active stage and active start time for instance of a business process flow.

When you create a business process flow, a new entity is created to maintain the instances of the business process flow. So each time you start an opportunity, a business process record is created for the business process that is running that maintains the start time, active stage and status of that process. Thus when you switch process the previous process flow state is maintained.

So with this knowledge you now have a record that records the relationship to the business process and to the record it was initiated from.

Back to the problem. What I need is an entity to store the start and end time for each stage and a workflow that creates the record each time the stage changes. Simple as follows:

  1. Create a new entity, in my case I used an activity entity called Stage Duration. I used an activity entity, as it already has all of the fields that I need to record the stage duration i.e. Regarding, actual start, actual end, and subject. The one field that I did create is Stage duration, which is a decimal and is a calculated field. The calculation works out the difference between Actual End and Actual Start.
  2. Stage Duration
  3. Once I have published the entity I now need to create a workflow to fire each time the active stage changes for the business process that I want to monitor.
  4. Create a new process – workflow, select the newly created entity that corresponds to the business process that you want to monitor.
  5. Set the workflow to run on creation and when the active stage field changes.
  6. Now add action to create the stage duration activity, populate the subject with something like Stage: <<Active Stage>>, populate the actual start with the “Active Stage start time”, update the owner to the owner of the related record and set the regarding to the related record.
  7. Stage duration workflow 2
  8. Now add a wait step to wait until the active stage start time is not equal to the new activity creates actual start time.
  9. Then add the step to update the actual end time to that of the Active stage started on. (this is now the next stage started on time thus the end of the previous stage)
  10. That is it you now have a workflow that triggers at the start of the process and again each time the active stage is changed. That will record the start, end and duration of stage per process stage and user.
  11. Here is the workflow example below:
  12. Stage duration workflow 1
  13. Now each time I change the process a new activity is created as below:
  14. Opportunity stage
  15. Stage duration record
  16. This allows me to create charts as follows, i.e. by stage average time, and by user by stage average time.
  17. Stage reporting

 

The possibilities are now endless to the types of things I can do i.e. alert if a stage has not changed after a given time period, alert if average time is over norm, create a nice dashboard to show exceptions or enable me to identify focus stages to work on.

Perform Action – Changing the business process via a workflow

So just taking a look at all of the available perform actions in workflows that are provided out of the box and found SetProcess.

SetProcess enables via a workflow to change the current business process of a record. For example, you are working on an opportunity and the decision timeframe is a year, this would most likely have a different sales approach to an opportunity closing in a month. Via a workflow we change the business process automatically.

So how do we do it? It’s easy follow these steps:

  1. Navigate to Settings->Processes
  2. Create a new process of type workflow, give it a name “Change process -long running opportunity” etc
  3. So for my example I create a condition on the Purchase Timeframe, if equal to This year then do action.
  4. I select perform action
  5. pefrom actiom
  6. I select SetProcess and click on properties. All I need to select is the business process and the record to apply it to.
  7. setprocess
  8. Save and close
  9. Finally Activate the process, all done.

When I navigate to my opportunity and update the purchase timeframe to This Year, once I refresh the record the business process will change.

setprocessoppty

 

How cool – creating word documents using a workflow

I just came across this feature the other day, using a pre-built action to generate a word document via a workflow. There are actually 100s of actions that you can explore in workflows that might actually remove some development.

So how do you generate a word document from a workflow, it’s really simple, just follow these simple steps. In my example I will use the OOB account summary template as an example.

  1. Navigate to Settings->Processes
  2. Create a new process of type workflow, give it a name “Generate Document” etc
  3. For my example I am going to make the workflow On Demand, jus to demonstrate the functionality, but think of these examples:
    1. Creating an opportunity summary at the develop stage of an opportunity
    2. Creating a campaign summary at the end of the campaign
    3. Creating a Case report
  4. At the end of the day this is a workflow so all workflow logic applies
  5. So for my example all I need to do is select Perform Action
  6. pefrom actiom
  7. Scroll down the many actions and select SetWordTemplate
  8. setwordtemplate
  9. Leave the Entity as None
  10. Click on Set Properties
  11. Select the template from the dropdown list
  12. Select Account
    1. NOTE: if you are using a custom entity, the entity is required to be enabled for Business Process Flows to be able to be added
  13. stewordproperties
  14. Save and Close
  15. Activate

That’s it, simple. Now when you go to an account record and select to run an on demand workflow, the Generate document will display.

Runworkflow

The document is stored as a note attachment against the record.

docgenerated

At the moment this solution does not attach to SharePoint, but I am sure clever people could expand this capability!

 

How to enable editable grids in D365

A great new feature in Dynamics 365 is the ability to make a view editable without the need for code, 3rd party solutions with security that is applied out of the box.

Editable grids work in the web and mobile clients, and work across main entity views, sub grids and associated views. When you configure editable grids on the main entity, you enable editable grids for the main entity forms. To enable on sub grids you need to open up the specific form and edit the properties of the sub grid to add the editable grid control.

Editable grids support:

  • In-grid editing of records at the entity or sub-grid level
  • Web and mobile clients
  • Navigation using a keyboard or mouse
  • Grouping and Sorting (Able to group by/sort by any column on current view)
  • Filtering
  • Moving and resizing columns
  • Pagination
  • Lookup configuration
  • Calculated fields and Rollup fields
  • Business rules
  • Hierarchical view
  • Enabling or disabling of cells based on security role

The Editable Grids control is available for Dynamics CRM Online and Dynamics CRM On-Premises.

Read the complete guide to setting up editable grids at https://blogs.technet.microsoft.com/lystavlen/2016/10/30/editable-grids-is-here/ by

 

 

Changing the Entity Tile Colour

Did you ever wish you could change the colour of one of the entity tiles like account from the Case from purple to say yellow?

Well in Dynamics CRM Online Spring 2015 Update 1 you now can and its really easy if you know your hex colours 🙂

So my scenario I want to change the Case Purple tile to Yellow, this is what it looks like out of the box:

Changingthe entity colour in the site map 0

To change it to yellow, follow these simple steps:

  1. Open up Settings->Customise the system
  2. Open up the entity you want to change in this scenario Case
  3. Now you will need to use a hex converter like http://www.colorhexa.com to identify the colour you want
  4. When you have the hex code simply update the field in the entity form labelled Colour, as below
  5. Changingthe entity colour in the site map 2
  6. Now save and publish the entity
  7. Refresh you CRM browser and now navigate to Case, you will see it has changed to the colour specified
  8. Changingthe entity colour in the site map 3

Happy colour changing!

CRM 2015 Update 1 Highlights – DiffinDays Calculated Field Update

I want an easy way to calculate the average time an opportunity is open for by sales person without writing any code.

Pre CRM 2015 Update 1, I would have to write some code to calculate the difference in days between created on and actual close date, then use a chart to display average for the sales person.

With the latest CRM Online release update 1 a new calculated field formula has been added “DiffinDays” this allows me to calculate the difference between two dates or difference between a date and Now.

So to solve my problem:

  1. Open up the solution file
  2. Navigate to the Opportunity entity -> Fields
  3. First of all I have to create a new field to store the actual close date, with the date behaviour set to User Local to match that of the created on date. The out of the box Actual close date is set to Date only which makes it incompatible with created on.
  4. Create a new field named “Number of days to close” as a whole number or decimal.
  5. Click on the field type and select Calculated
  6. In the designer, create the following rule, you can use the intelisense to type ahead
  7. calculated rule
  8. Save and the new field to a view and to the form optionally
  9. Now you will need to create a workflow to populate your new date field, simple check for actual close date to be populated and then update the new actual close date.
  10. Save and Publish
  11. Now navigate to the opportunity view for closed opportunities
  12. Create a new chart as follows:
  13. average days chart
  14. You now have the average open days for won and lost opportunities by sales person

As a note the image below depicts the entire set of Diff functions:

diffindays

Check your De-dupes and Auditing after solution imports

I thought I would re-iterate a point raised by ClickDimensions and others around importing of solutions.

If you import a solution that modifies the metadata of an entity i.e. Account that has a de-duplication rule or auditing on, then post the solution the Rules and Auditing will be unpublished.

So check your solution and build a plan post imports to regression test your solution. 3rd party solutions that auto update and overwrite customisations may also revert your solution back to default settings, so just be aware of the impacts before you enable them.