# How do you secure record visibility for external contractor technicians in Salesforce Field Service using sharing, permission sets and territories?

**Topic:** Field Service · **Difficulty:** Medium · **Asked at:** Accenture, Cognizant, Deloitte · **Tags:** Contractors, Sharing, Security, Field Level Security

Read it on the site: https://www.forcechallenges.com/interview-questions/how-do-you-manage-record-visibility-and-data-security-for-external-contractor-resources

## Answer

External contractors should see **only the records they need**, so security is built on least privilege.

**Approach**
1. Set **organization-wide defaults** for Work Order, Service Appointment and Account to **Private** (or Controlled by Parent where it fits).
2. Give contractors a **restricted permission set** with only the objects and fields they need.
3. Group contractor resources by **Service Territory** or by contractor company.
4. Share records with them through **sharing rules, public groups or Apex managed sharing**, based on territory or contractor account.
5. Hide sensitive fields such as price, margin and other customers' data with field-level security.

```apex
WorkOrderShare shareRecord = new WorkOrderShare(
    ParentId = workOrderId,
    UserOrGroupId = contractorUserId,
    AccessLevel = 'Edit',
    RowCause = 'Manual'
);
insert shareRecord;
```

**Good practice**
- Remove access when the job is completed or the contract ends.
- Audit access regularly.
- Consider capacity-based resources for subcontractors who manage their own technicians.
- Test by logging in as a contractor user.

---
Source: ForceChallenges · last updated 2026-10-31
