This is a follow on article from Execute Formula - Button on Form.
In this article we will attach a ribbon button to a list view on Dynamics 365.
Note: After version 184.108.40.2060 North52 supports calling other formula types like this, but only ClientSide - Calculation will allow you to return a response to the calling screen.
Step 1: Configure the N52 Formula
The formula below will clone the existing Quote:
Step 2: Add the Quick Ribbon to the entity using Ribbon Workbench
- Open Ribbon Workbench and connect to your instance of Dynamics 365
- We have created a solution with just the Quote entity added to it:
- Configure a Command by clicking on the + icon. We change the name to new.quote.N52.ListViewCloneCommand
- The first three will be used to load N52 support files on the button and the fourth will be used to execute the formula
- The function name should be set to isNaN
- Unlike the form, we will be passing in 4 parameters instead of just one.
- Crm Parameter: SelectedControlSelectedItemsIds
- Crm Parameter: SelectedEntityTypeName
- Crm Parameter: UserLcid
- String Parameter: shortcode of the formula
- Drag a button onto the form. We set the ID to be new.quote.N52.ListViewCloneButton and name it Clone Quotes
- Set the Command to be the newly created command. For this example, we will use the create new order icon:
- Publish the Solution
List of Quotes in Dynamics 365
- In the screen capture below, there are 8 quote records. We select them all and then click on the Clone Quotes ribbon button
Confirmation DialogsIt is possible to include a confirmation dialog in a Quick Ribbon on a list view.
- To do this you would simply add another string parameter to the Quick Ribbon containing the text you want to display
- In the example below, before executing the formula GFW, we will ask the user if they are sure that they want to charge this customer:
- This additional string parameter has been added to the button: Close & Charge
- A pop up dialog will ask me to confirm that I want to do this action:
- Clicking OK will execute the formula. If Cancel is clicked then the formula will not be executed.