Configure Microsoft Teams with Custom Scripts
You can configure Microsoft Teams to match your business requirements by writing custom scripts using JavaScript that enforce validations and rules.
Create a Script and Assign to Microsoft Teams
Here's how you create a script and assign to Microsoft Teams:
-
Select the sandbox you want use for your configuration.
-
Select
. -
Click the CX Sales Mobile Scripts tab at the top of the Mobile Application Setup page.
-
To create a script for a top-level parent object, select the object you want to write a script for, and then select the event that will trigger your script. You can choose one of these events:
-
On Create (triggered when a new record is created in the mobile app).
-
Before Save (triggered before a record is saved).
-
After Save (triggered after the app has saved the record).
-
-
Click the plus icon in the <Event Name> Scripts section.
-
Enter the script name and description.
-
(Optional) If you want the script to work for particular regions, select geographical regions for the script. The script will work for users who have your selected regions as their country preference setting in the CX Sales app.
Note: A script can have multiple regions associated to it, but the same region can't be assigned to more than one active script for the same object and event.If you want to restrict your script to trigger for certain user roles, you will need to specify these by writing a JavaScript script
Select Microsoft Teams as your assigned channel and click Create to create your script.
-
Click Validate to check whether your script has any errors. The validation checks include checks for nested functional calls and anything else in the script that will cause it to run forever in an infinite loop.
-
When you're finished, click Save.
Assign Existing Scripts to Microsoft Teams
You can also assign existing scripts for CX Sales Mobile to Microsoft Teams if the requirements for both channels are the same.
Here's how you add an existing script and assign to Microsoft Teams.
-
Select the sandbox you want use for your configuration.
-
Select
. -
Click the CX Sales Mobile Scripts tab at the top of the Mobile Application Setup page.
-
Choose the event and locate the existing script that you want to assign to Microsoft Teams.
-
Select Microsoft Teams as your assigned channel.
-
Click Validate to check whether your script has any errors. The validation checks include checks for nested functional calls and anything else in the script that will cause it to run forever in an infinite loop.
-
When you're finished, click Save.