Object Reference for the Salesforce Platform
Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
OrderOwnerSharingRule
To enable access to this object for your org, contact Salesforce customer support. However, we recommend that you instead use Metadata API to programmatically update owner sharing rules because it triggers automatic sharing rule recalculation. The SharingRules Metadata API type is enabled for all orgs.
Note
Supported Calls
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), update(), upsert()
Fields
| Field | Details |
|---|---|
| CreatedById |
|
| CreatedDate |
|
| Description |
|
| DeveloperName |
|
| GroupId |
|
| Id |
|
| LastModifiedById |
|
| LastModifiedDate |
|
| Name |
|
| OrderAccessLevel |
|
| SystemModstamp |
|
| UserOrGroupId |
|
Usage
Use this object to manage the sharing rules for orders. For example, the following code creates an order owner sharing rule between two public groups, which can also contain portal users.
1OrderOwnerSharingRule rule = new OrderOwnerSharingRule();
2rule.setName("RuleName"); // Set the sharing rule name
3rule.setDeveloperName("RuleDeveloperName"); // Set the sharing rule developer name
4rule.setGroupId("00Gx00000000000"); // Set the group of users to share records from
5rule.setUserOrGroupId("00Gx00000000001"); // Set the group of users to share records to
6rule.setOrderAccessLevel("Edit");
7connection.create(rule);