Cette entrée n'est pas disponible en français. Par conséquent, le texte anglais est affiché.
The following example shows how a Dynamics 365 Workflow can calculate the portatour® call interval for accounts dynamically.
The call interval is calculated by the workflow according to the annual revenue and is saved in a user-defined field:
Annual revenue | Call interval |
No data | 0 days* |
€0 to €10,000 | 90 days |
€10,000 to €100,000 | 60 days |
more than €100,000 | 30 days |
*) 0 days means: 'do not visit this customer regularly'.
The workflow should be applied if:
- A new account is entered.
- The field Annual Revenue of an account changes.
- The call interval for an existing account is initialized once.
Create a field
The calculated call interval is saved in a custom field of the Account entity. Follow these steps to create it:
- Navigate to Settings > Customization > Customizations > Customize the System. A pop-up window opens. (Alternatively, create your own solution for this example (Settings > Customization > Solutions > New) and open this solution. You can find out more about the use of solutions at Package and Distribute Extensions in the Microsoft Developer Network).
- Navigate to Components > Entities.
- Select the entity Account. (If the entity Account is not displayed, select Add available element and select Account. In the window Missing required components select No, do not include required components.)
- In the component tree on the left, select Fields under the entity Account.
- Select New and create the following field:
Label Calculated Call Interval Name new_CalculatedCallInterval Type Integer Minimum Value 0 Maximum Value 730 - Save and Close this field.
- Select in the solution window Publish All Customizations.
Create a workflow
- In the component tree on the left, select Processes and click on New.
- Enter the following settings:
Process name Calculate Call Interval Entity Account Category Workflow Type New blank process - Click on OK. A window is displayed where the workflow that has just been created can be customized.
- Select the following settings:
Activate As Process Available to Run ✓ As an on-demand process Scope Organization Start when ✓ Record is created ✓ Record fields change
- Under Record fields change, click on View and select the field Annual Revenue.
The following steps must be carried out a total of 4 times. The first time, select the settings indicated in the text. For the three repetitions, select the settings listed below.
- Click on Add step in the lower section of the window and select View properties.
- Enter New customer as the Name of the step.
- Click <Property> (click to Configure).
- Enter the following property: Account – Annual Revenue – does not contain data
- Save and Close the property.
- Click on Select this line and click on 'Add step'.
- Click on Add step and select Update record.
- Enter Call interval: 0 days as the name of the step.
- Select in this step Update - Account.
- Click on Set properties.
- A form with all the fields of the account entity is displayed. Select the field Calculated Call Interval and enter the value 0.
- Save and Close the form with the account fields.
Repeat the steps above with the following settings:
Repeat 1:
- Step: View properties
- Name: Annual turnover up to €10,000
- Property: Account – Annual Revenue – Is less than €10,000.00
- Step: Update record
- Name: Call interval: 90 days
- Value for the field Calculated Call Intervall: 90
Repeat 2:
- Step: View properties
- Name: Annual revenue up from €10,000 to €100,000
- Property:
- Account – Annual Revenue – Is more than or equal to – €10,000.00
- Account – Annual Revenue – Is less than – 100,000.00
- Step: Update record
- Name: Call Interval 60 days
- Value for the field Calculated Call Interval:60
Repeat 3
- Step: View properties
- Name: Annual revenue from €100,000
- Property: Account – Annual Revenue – Is greater than or equal to – €100,000.00
- Step: Update record
- Name: Call Interval 30 days
- Value for the field Calculated Call Interval:30
Save the workflow.
Activate the workflow by clicking on Activate in the menu.
Following screenshots show the completed workflow:
Initialization of existing accounts
The workflow for calculating the call interval for an account is applied when it is first created or if the annual revenue field changes.
To initialize the calculated call interval for existing accounts according to the annual revenue, carry out the workflow manually for all accounts.
- Open a window that displays all the accounts that are to be initialized. To do this, either go to Workplace - Accounts and select the desired view, or open the extended search to search for all companies that are to be initialized.
Tip: Increase the number of records displayed on each page to 250 in the Dynamics 365 options (menu Record - Options). - Select all the records shown on the first page of the view or search.
- In the menu, click on Apply workflow, select the workflow Calculate Call Interval and confirm the application of the workflow.
- After the workflow has been applied to all these accounts, navigate to the next page of the display and run the workflow again for all the accounts on this page.
- Repeat this process, until the workflow has been applied to all the accounts.
As workflows in Dynamics 365 are applied asynchronously, it usually takes a few seconds or minutes for the initialization of all accounts to be completed.
Set the field in the Organization Settings
For portatour® to apply the new field new_CalculatedCallInterval when planning calls, the field has to be selected in the Organization Settings(see also Call settings - Scheduling Parameters).
- In Dynamics 365, navigate to portatour® Route Planning App > Administration > Overview > Organization Settings.
- Open the Customer Call Settings tab.
- Under Call interval remove the check-mark next to Standard and select Calculated.
- Under Account field select Calculated Call Interval.
- Save and close the window.
Start the synchronization
Start the portatour® synchronization (see Synchronize all users). The calculated call interval for accounts is now available in portatour® Anywhere.