Package: TimeCards |
Community Private Sharing Rules with Back Office
We recommend you use a Salesforce open Sharing Model, which means everyone has access to all Records. However, we understand this is not ideal for some customers, especially those that run multiple business lines through the same Salesforce environment.
For these instances, you can implement a Private Sharing Model. Unfortunately, a Private Sharing Model will hide content if the Jobscience Backoffice, with Community access, is in use. Example - an Approving Manager won't be able to see the Worker's Name. The following steps, completed by a User with System Admin permissions, will allow the content to be displayed on the Community.
Tip: These Steps are written from the Salesforce Classic UI.
Part 1: Create a Lookup Field
-
Navigate to Setup > Customize > Contacts > Fields.
-
Go to New within Contact Custom Fields & Relationships.
-
Choose Lookup Relationship.
-
Proceed to Next.
-
Pick Account from the Related To dropdown.
-
Select Next.
-
Populate the Field Label as desired, example Placement Client Account
-
Populate the Description, Help Text, and Child Relationship Name Fields as desired - these are optional
-
Proceed to Next.
-
Determine the correct Field Access for each Profile with the Visible and Read-Only columns - leaving as the default is usually acceptable
-
Select Next.
-
Determine if the Field should be placed on Page Layouts - it would be recommended to uncheck all options
-
Go to Next.
-
Update the Related List Label, if desired
-
Determine if the Related List should be placed on Page Layouts - it would be recommended to uncheck all options
-
Save your changes.
Part 2: Create a Process Builder
-
Navigate to Setup > Create > Process Builder.
-
Go to New.
-
Populate the Process Name, as desired, example Placement Client Account Update.
-
Populate the Description Field, if desired - this is optional.
-
Choose A record changes in the The process starts when dropdown
-
Proceed to Save.
-
Select + Add Object.
-
Pick Placement in the Find an object... box.
-
Choose when a record is created or edited.
-
Save your changes.
-
Select + Add Criteria.
-
Populate the Criteria Name, as desired, example Client is Populated.
-
Populate the Set Conditions to reflect:
-
Field: ts2__Client__c, which will be reflected as [ts2__Placement__c].ts2__Client__c
-
Operator: Does not equal
-
Type: Global Constant
-
Value: $GlobalConstant.Null
-
-
Save your changes.
-
Navigate to + Add Action.
-
Choose Update Records in the Action Type Field.
-
Populate the Action Name, as desired, example Employee.
-
Pick Select a record related to the ts2__Placement__c > Employee in the Record Type Field.
-
Populate the Set new field values for the records you update to reflect:
-
Field = Placement Client Account (or the item you created in PART 1 above)
-
Type = Formula
-
Value = ts2__Client__c, which will be reflected as [ts2__Placement__c].ts2__Client__c
Repeat Steps 15-19 as desired for other Contact Lookup Fields on the Placement Object, such as Secondary Approver and Timecard Approver.
-
-
Select Activate when ready.
Part 3: Update the Records
-
Update any Placement Records that will need this new Field populated.
Options include, but not limited to:-
InLine Editing a Field from a List View
-
Data Operation using Data Loader (or a similar product)
-
Click the Edit and Save buttons on the Placement Record (no actual change is needed to any Field)
-
Part 4: Create the Community Sharing Rule
-
Navigate to Setup > Communities > Communities Settings > Sharing Sets.
-
Go to New within the Sharing Sets section.
-
Populate the Label, as desired, example Contact Sharing.
-
Pick the desired Profile(s), likely JS Community Hiring Manager and JS Community Contractor.
-
Choose the desire Object(s), likely Contact.
-
Select Set Up within the Configure Access section.
-
Pick the newly created Field from PART 1 for the User Field, likely Contact.Placement_Client_Account__c.
-
Choose the newly created Field from PART 1 for the Target Contact, likely Placement_Client_Account__c.
-
Proceed to the desired Access Level, Read Only is sufficient.
-
Update and Save to confirm your changes.
You will likely receive a warning that the Sharing Rule will take some time to process. Once complete, the Sharing Rule is live and will be reflected by displaying the proper content inside the Community.