Restrict Access to Workflow Rules based on Teams

By | December 10, 2014

In our earlier post, we had explained how to restrict any particular user from accessing workflow rule. Refer below link. Restricting Workflow rules to Assigned User
New Stuff: Secure Documents and Communications in Sage CRM
In this blog, we will explain how to restrict access on Workflow Rules based on Teams. Consider an example, where you want to show Proposal Submitted workflow Rule only for the Sales Team.
Workflow Rule can be easily restricted by below 2 ways.
1) Workflow Customization:
a) Navigate to Proposal Submitted Rule and you will find Restricted to Team dropdown.
WF1
b) Set this field to Sales Team and Click on Save button.
c) Once this is done, Proposal Submitted will be only visible for Sales Team.

2) Workflow Customization by adding JavaScript Condition:
Suppose you want to provide access to Proposal Submitted rule only for Marketing and Direct Sales Team, then you need to add below script into the JavaScript condition of Proposal Submitted Rule.
var TeamID = CurrentUser.user_primarychannelid;
if (TeamID == 1 || TeamID == 4)
Valid = true;
else
Valid = false;
WF2
You must have wondering that how to add Team ID’s into the above code. You just need to execute query on Sage CRM SQL database as shown below.
WF3
Click on Save button and check the same.
You can modify above code to meet your requirements.
Also Read:
1) Workflow Tip to set Document Type and Category
2) Hide Tracking Note field while progressing workflow
3) Hash fields in Workflow Execute SQL Statements
4) How do you find the Workflow Action Buttons from custom content?
5) WORKFLOW IN SAGE CRM 2014 R2