Getting started with Actions in Dynamics 365 & Smart Buttons in Ribbon Workbench 2016

Actions are a type of process within Dynamics CRM/365 that you may or may not have already heard of. They are not as well known as workflows and are viewed as an internal operation rather than something that can be configurable. This mindset could be because we are so used to creating workflows, dialogs, or even plugins that have a starting or ‘trigger’ point, and are so caught up making business logic for those that we forget we can create a component that is in fact, reusable across all of these types of customisation and only have to make it once.

How to add a timer on a form

In the Spring ’14 release the ‘timer’ functionality was added and this post will show you how to add it to a form and some uses for it. Something worth noting, the name is a little misleading, whilst this functionality can certainly count down/up and in all instances you do have to set a ‘Failure time field’ i.e. a field to start the timer (otherwise it will stay at ‘not set’), it can just be used for setting conditions to meet on the form as well, a popular one being ‘Customer Contacted’ and this would mean that once you have set the ‘Customer Contacted’ field on the Case, the field would change to ‘Succeeded’ in a nice positive green colour.

I don’t see why you can’t circumvent the timer and if you don’t actually want the timer to ever start, even by accident, create a new custom field on the form that is a DateTime type, hide it, set the Failure Time Field as this field and then set your success condition. Then you have circumvented the counter functionality to just display ‘Not Set’ to ‘Succeeded’. If that meets your requirement.

A few things to note:

You can add this on most entities, not just the case type
You don’t need to set up SLA’s, entitlements or contracts (Unless you specify the time field to be linked to any of these)

The Timer functionality has the following fields:

Failure Time Field: This is your start field – This needs to be set as a mandatory field – it needs a time field to be able to know when to start counting down to or from
Success Condition: This is your end field – This is also mandatory, and you have many different types of fields that you specify first, then the actual field selection i.e. yes, no or the specific status for example
Failure Condition: This is optional – you can basically set a condition for failure, this, as far as my experience goes, gives you the same set of options as the ‘success condition’
Warning Condition: This is optional – a condition to be met to display a warning, same options as ‘success condition’
Cancel Condition: This is optional – a condition to be met to display a warning, same options as ‘success condition’

To set the timer on the field

Go to your solution, navigate to the entity you wish to add the timer to, and go to the specific form.
On the form, click ‘Insert’
To the far right of the ribbon you will see ‘Timer’
Click it and it will come up with a pop up ‘Timer Control’; sett your name and labels and your Data Source fields (described above)
Click okay and it would have dropped into the form, move it about as you wish
Save & Publish, Publish All
Go have a play with your new Timer!

 

Hiding ‘Add New’ & ‘Add Existing’ buttons (without using the ribbon editor or code!)

A frequent issue, something that is evident in both 2011 & 2013, is the ‘add new and add existing’ buttons on the ribbon bar on certain entities  (normally new customised ones) and getting rid of these as it causes confusion for clients, especially when they will to ‘add existing’ only to select one and be notified it has already got a parent. 

 

 

A specific 2013 issue that comes with this is when using subgrids on related entities, you’ll find there is a selectable ‘+’ mark which opens up the search bar in the subgrid rather than making a new record. This functionality is also due to the ‘add existing’ button being available from the navigation bar

.

To get rid of these buttons, without going into the ribbon editor or using any code, is to make the related field, depending on which side of the relationship you want to remove, business required.*.

In this example, I’ve created a new ‘Project’ entity, and associated it to the ‘Account’ oob entity. I’ve added the ‘Account’ lookup to the Project form, and the Account forms have the ‘Project’ navigation rectangle on it.

I’ve made the Account lookup, which is the side of the relationship I want to edit, (think of it as ‘where am I sitting?’ – on the Account, or the Project? In this case I’m sitting at the Account only wanting to add new Projects, so if i make the related relationship lookup on the Project Mandatory, I can not save a record that is not associated to an account, and therefore the ‘Add Existing’ button becomes useless, thus, disappearing.)

Below, you can see the ‘Add Existing’ button has now disappeared.