OrderOwnerSharingRule

Represents a rule which determines order sharing access for the order’s owners.

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()

Special Access Rules

Customer Portal users can't access this object.

Fields

Field Details
CreatedById
Type
reference
Properties
Defaulted on create, Filter, Group, Sort
Description
ID of the creator of the order owner sharing rule.
CreatedDate
Type
dateTime
Properties
Defaulted on create, Filter, Sort
Description
Date when the order owner sharing rule was created.
Description
Type
string
Properties
Create, Filter, Nillable, Sort, Update
Description
Description of the order owner sharing rule. Maximum length is 1,000 characters.
DeveloperName
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Name of the developer of the order owner sharing rule.
GroupId
Type
reference
Properties
Create, Filter, Group, Sort
Description
ID of the group whose orders are shared.
Id
Type
ID
Properties
Defaulted on create, Filter, Group, idLookup, Sort
Description
ID of the order owner sharing rule.
LastModifiedById
Type
reference
Properties
Defaulted on create, Filter, Group, Sort
Description
ID of the user who last modified the order owner sharing rule.
LastModifiedDate
Type
dateTime
Properties
Defaulted on create, Filter, Sort
Description
Date when the order owner sharing rule was last modified.
Name
Type
string
Properties
Create, Filter, Group, idLookup, Namefield, Sort, Update
Description
Name of the order owner sharing rule. Maximum length is 80 characters.
OrderAccessLevel
Type
picklist
Properties
Create, Filter, Group, Restricted picklist, Sort, Update
Description
Access level for the order owner sharing rule.
SystemModstamp
Type
dateTime
Properties
Defaulted on create, Filter, Sort
Description
System modification time for the order owner sharing rule.
UserOrGroupId
Type
reference
Properties
Create, Filter, Group, Sort
Description
ID of the user or group with whom order access is shared.

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.

OrderOwnerSharingRule rule = new OrderOwnerSharingRule();
rule.setName("RuleName"); // Set the sharing rule name
rule.setDeveloperName("RuleDeveloperName"); // Set the sharing rule developer name
rule.setGroupId("00Gx00000000000"); // Set the group of users to share records from 
rule.setUserOrGroupId("00Gx00000000001"); // Set the group of users to share records to
rule.setOrderAccessLevel("Edit");
connection.create(rule);