Friday, June 28, 2019

Deploy a Record-Level Client Script to execute on Web Store Context only

Currently, when deploying a Record-level Client script, there is not an option to control script execution by Context (ex. User Interface, Web Store, Web Services). Developers have to control this logic on the actual script code via nlobjContext.getExecutionContext().

Here are the steps on how to set a script to execute only on Web Store Context from the Script Deployment record.


1. Make sure there is a specific custom Customer Center role assigned/used for your Web Store users/shoppers.

2. Set this specific custom role as default by navigating to Setup > Company > General Preferences, Default Role for New Customers field.

3. When deploying the Client script, on the Script Deployment record > Audience > Roles, select the specific custom role only.

4. Click Save.


Note:
- If you do not have a specific custom Customer Center role and will be creating a new one, you may need to mass update role assignment on existing Customer records.
- This solution can also be used if you want a client-script to not execute on Web Store context, by selecting All roles except the specific custom Customer Center role (i.e. Customer is using SCO, but has a record-level Client Script that they do not wish to run on Web Store context only).

No comments:

Post a Comment