Print this page

Work.com: Grant visibility into private goals without requiring manual sharing

Knowledge Article Number 000205442
Description How to grant visibility into private goals without requiring manual sharing? In some organizations, certain users need view access into private goals without being invited. e.g. sales ops, HR or sales leaders requiring access to a sales person’s private goals.

 
 

Resolution Role hierarchy and manager hierarchy is not supported but there are a couple of options:
  1. Organizational Wide Defaults: For very transparent orgs, goals can be made public under Setup | Security Controls | Sharing Settings. Change Goals to Public Read Only
  2. View All: It’s possible to grant visibility to all goals for certain users by granting “view all” on the Goal object to users requiring access to all goals. This can be applied either on the profile or via a permission set.
  3. Sharing Rules: Sharing rules can grant visibility owned by members of a group, or in a certain role to members of another group, or role. For example, grant visibility to all goals in the sales organization to the HR role or to the Sales Operations group. Sharing rules can be found under Setup | Security Controls | Sharing Settings.
  4. Triggers: It’s possible to add fine grained visibility via manual sharing rows in a trigger. For example, a trigger can run after a goal is created and add sharing rows for the owner’s manager, manager’s manager, etc.
Note that in Reports there are a couple of filters. All goals displays all goals you have visibility into. However, "My Team's Goals" filter requires role hierarchy. For more information, please click here.
 
Trigger example to share the Goal with direct manager:
trigger ShareWithManagerAfterCreate on WorkGoal (after insert) {
   for (WorkGoal goal : Trigger.new) {
       List<User> owners = [SELECT ManagerId FROM User WHERE id = :goal.ownerId];
       if (!owners.isEmpty()) {
           WorkGoalShare share = new WorkGoalShare(
               ParentId=goal.id, // the id of the goal or metric
               UserOrGroupId=owners.get(0).managerId, // the user to share with
               AccessLevel='Edit' // this can be either ‘Read’ or ‘Edit’
           );
           insert share;
       }
   }
}
 

 




promote demote