You are on page 1of 9

Project Auto Calculation

Setup Guide

Deliverables
1 DLL file representing the CustomAction to be registered.
1 PDF document representing a step by step guide on how to import and use the CustomAction.

Requirements
Microsoft Software Development Kit (SDK) for Microsoft Dynamics CRM Online and CRM 2016 (on-premises).
A running Microsoft Dynamics CRM system.
A user with Administrative privilege.

Steps
Register the DLL file using the Plugin Registration Tool (part of the SDK)
Create Project Tree Calculation Workflow.
Create Project Calculation Bulk Action.
Create a View that can be used with the Project Calculation Bulk workflow
Create Project Calculation Bulk Workflow.
Schedule the Project Calculation Bulk Workflow as per your business needs.

Register the DLL file


1. Start the Plugin Registration Tool (part of the SDK).
2. Click on the Create New Connection button to establish a connection to your Microsoft Dynamics CRM system,
make sure to use Administrative privileges to sign in.

Abbildung 1

3. Once logged in and all plug-ins are loaded, click on the Register button, then Register New Assembly.
Abbildung 2

4. Browse to and open the CustomAction DLL file (one of the deliverables).
5. Make sure to Select All workflow activities, then click the Register Selected Plugins button.

Abbildung 3

6. Once registered, a notification will show up with the registered assemblies and plugins, click OK. Close the Plugin
Registration Tool.
Abbildung 4

Abbildung 5

Create Project Tree Calculation Workflow


This workflow is used to calculate the Root node of the Project, plus all the sub-nodes below (Subproject, Phase, Work
Package).
1. Go to Microsoft Dynamics CRM > Settings > Processes, and click on New from the menu.

Abbildung 6
2. In the Create Process window, fill in the required fields
a. Process Name: Project Calculation - Tree (or any name that is clear, understandable, and meets your
business specifications)
b. Category: Workflow
c. Run this workflow in the background: True
d. Entity: Project
e. As an on-demand process: True
f. As a child process: True
g. Scope: Organization
h. Start when: all checkboxes False
3. Click on the Add Step button > xRM1.CustomAction >
xRM1.CustomAction.Services.ProjectTreeCalculationServices

Abbildung 7

4. Click on the Set Properties button.

Abbildung 8
5. In the Set Custom Step Input Properties window, set the value of the Project Property name from the Form
Assistant section:
a. Project (as Primary Entity)
b. Project (in the second field)
6. Click Add, OK, Save and Close

Abbildung 9

7. Save the workflow, Activate, then Close the workflow window.

Create Project Calculation Bulk Action


1. Go to Microsoft Dynamics CRM > Settings > Processes, and click on New from the menu.
2. In the Create Process window, fill in the required fields
a. Process Name: Project Calculation - Bulk - Action (or any name that is clear, understandable, and meets
your business specifications)
b. Category: Action
c. Entity: None (global)
3. In the Process Arguments section, add the following arguments:
Name Type Entity Required? Direction
View EntityReference View Required Input
Workflow EntityReference Process Required Input
StartIndex Integer Optional Input
MaximumExecution Integer Optional Input
Tabelle 1

4. Click on the Add Step button > xRM1.CustomAction >


xRM1.CustomAction.Services.ProjectBulkCalculationServices
5. In the Set Custom Step Input Properties window, set the values of the Property name from the Form Assistant
section as follow:
a. View > Argument Entity = View(View) > View
b. Workflow for Project Tree Calculation > Argument Entity = Workflow(Process) > Process
c. Start index for workflow execution > Local Values = Arguments > StartIndex
d. Maximum workflow execution > Local Values = Arguments > MaximumExecution
Abbildung 10

6. Save and Close.


7. Save the workflow, Activate, then Close the workflow window

Create a View that can be used with the Project Calculation Bulk workflow
In this View, you can specify some criteria for Projects that will be automatically calculated based on the schedule you
specify to run the Project Calculation Bulk Workflow.
1. Go to Settings > Customizations > Customize the System > Entities > Projects > Views
2. Click on the New button

Abbildung 11

3. Fill in the Name of the View, click OK.


4. In the View window, click on the Edit Filter Criteria button, and define the filter needed.

Abbildung 12

Abbildung 13

5. Click OK, then Save and Close.

Create Project Calculation Bulk Workflow


1. Go to Microsoft Dynamics CRM > Settings > Processes, and click on New from the menu
2. In the Create Process window, fill in the required fields
a. Process Name: Project Calculation - Bulk (or any name that is clear, understandable, and meets your
business specifications)
b. Category: Workflow
c. Run this workflow in the background: True
d. Entity: Project
e. As an on-demand process: True
f. As a child process: True
g. Scope: Organization
h. Start when: all checkboxes False
3. Click on the Add Step button > xRM1.CustomAction >
xRM1.CustomAction.Services.ProjectBulkCalculationServices
Abbildung 14

4. Click on the Set Properties button.


5. In the Set Custom Step Input Properties window, set the values Manually as follow:
a. View > choose the View created in the step Create a View that can be used with the Project Calculation
Bulk workflow
b. Workflow for Project Tree Calculation > choose the workflow created in the step Create Project Tree
Calculation Workflow
c. Custom action request name > here you fill in this field with the Unique Name of the action created in
the step Create Project Calculation Bulk Action
Abbildung 15

d. Start index for workflow execution > 0


6. Save and Close

Abbildung 16

Schedule the Project Calculation Bulk Workflow as per your business needs
Once everything is set up, now you can schedule the workflow created in the step Create Project Calculation Bulk
Workflow to run according to your need (daily, at specific time)