Skip to main content
In certain scenarios it can be necessary to ask user for input or confirmation before completing process, using this method we allow for creating a simple dialog which will return input back to CRMScript trigger, based on this you should be able to create a useful workflow. A simple real-life scenario could be that when your users are booking new customer meetings they often forget to add travel time in their calendar. The functionality will behave like this:
  1. When user creates a new appointment we will start by asking if they would like to add travel time.
  2. If user confirms this we should ask for additional input and capture duration.
  3. Based on this we will create an additional appointment of specific type in calendar.
Script triggered dialog are not supported on BeforeSave and AfterSave triggers on Document and Quoteline dialogs. Having multiple dialogs appear is not a great user experience, and due to some legacy challenges, this feature has been postponed for these dialogs.

Implementation

We will start by creating a new CRMScript trigger for event Before saving appointment.
  • In Sales, click the burger menu in the top right corner and click Settings and maintenance. Then in the left menu, you can find CRMScript.
  • In Service, click the cogwheel in the top right corner, click System design and then CRMScript.
  1. Click the New trigger (script) in the trigger pane. In the search box, type Before saving company and click the trigger.
  2. The Description field should contain a short description of what your trigger is doing, in this case, I’ll write Travel time confirmation.
    • If you want this trigger to be enabled, remember to click the toggle box on the right side.
  3. In the textbox below is where we will add our CRMScript code.
trigger creation -screenshot

Step 1

When creating a new appointment we should open a small dialog to prompt user if they would like to add travel time. first dialog asking for confirmation -screenshot To accomplish this we will start by adding CRMScript below to our trigger:
If user selects “Yes” we should open a new dialog to capture input from user in next dialog step. capturing input from user -screenshot

Step 2

Continuing our current CRMScript trigger with adding additional dialog;
If user chooses to complete this dialog, we should add a new appointment of a specific type with duration user gave in dialog.

Step 3

Putting it all together we are able to provide very useful automation;
diaryresult -screenshot Hopefully this has given a good overview of how to utilize this to automate tasks, and chaining dialogs together.