Is there a typesafe way to work with rowCause?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty{ margin-bottom:0;
}
up vote
1
down vote
favorite
On the project I'm currently working with, we have Apex Sharing Rules.
I see we are passing rowCause as a String everywhere.
But the values of these Strings look like API names.
Is there a typesafe way we can work with these?
apex api apex-managed-sharing sharing-rule type
add a comment |
up vote
1
down vote
favorite
On the project I'm currently working with, we have Apex Sharing Rules.
I see we are passing rowCause as a String everywhere.
But the values of these Strings look like API names.
Is there a typesafe way we can work with these?
apex api apex-managed-sharing sharing-rule type
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
On the project I'm currently working with, we have Apex Sharing Rules.
I see we are passing rowCause as a String everywhere.
But the values of these Strings look like API names.
Is there a typesafe way we can work with these?
apex api apex-managed-sharing sharing-rule type
On the project I'm currently working with, we have Apex Sharing Rules.
I see we are passing rowCause as a String everywhere.
But the values of these Strings look like API names.
Is there a typesafe way we can work with these?
apex api apex-managed-sharing sharing-rule type
apex api apex-managed-sharing sharing-rule type
asked 2 hours ago
Brian Kessler
1,4711131
1,4711131
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
Refer this documentation: Sharing a Record Using Apex
Apex sharing reasons are defined on an object's detail page. Each Apex sharing reason has a label and a name:
- The label displays in the Reason column when viewing the sharing for a record in the user interface. This label allows users and administrators to understand the source of the sharing. The label is also enabled for translation through the Translation Workbench.
- The name is used when referencing the reason in the API and Apex.
All Apex sharing reason names have the following format:
MyReasonName__c
Apex sharing reasons can be referenced programmatically as follows:
Schema.CustomObject__Share.rowCause.SharingReason__c
For example, an Apex sharing reason called Recruiter for an object called Job can be referenced as follows:
Schema.Job__Share.rowCause.Recruiter__c
So, sharing reason must be used which you have defined and that's why it takes API name. It always hold String value.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Refer this documentation: Sharing a Record Using Apex
Apex sharing reasons are defined on an object's detail page. Each Apex sharing reason has a label and a name:
- The label displays in the Reason column when viewing the sharing for a record in the user interface. This label allows users and administrators to understand the source of the sharing. The label is also enabled for translation through the Translation Workbench.
- The name is used when referencing the reason in the API and Apex.
All Apex sharing reason names have the following format:
MyReasonName__c
Apex sharing reasons can be referenced programmatically as follows:
Schema.CustomObject__Share.rowCause.SharingReason__c
For example, an Apex sharing reason called Recruiter for an object called Job can be referenced as follows:
Schema.Job__Share.rowCause.Recruiter__c
So, sharing reason must be used which you have defined and that's why it takes API name. It always hold String value.
add a comment |
up vote
2
down vote
Refer this documentation: Sharing a Record Using Apex
Apex sharing reasons are defined on an object's detail page. Each Apex sharing reason has a label and a name:
- The label displays in the Reason column when viewing the sharing for a record in the user interface. This label allows users and administrators to understand the source of the sharing. The label is also enabled for translation through the Translation Workbench.
- The name is used when referencing the reason in the API and Apex.
All Apex sharing reason names have the following format:
MyReasonName__c
Apex sharing reasons can be referenced programmatically as follows:
Schema.CustomObject__Share.rowCause.SharingReason__c
For example, an Apex sharing reason called Recruiter for an object called Job can be referenced as follows:
Schema.Job__Share.rowCause.Recruiter__c
So, sharing reason must be used which you have defined and that's why it takes API name. It always hold String value.
add a comment |
up vote
2
down vote
up vote
2
down vote
Refer this documentation: Sharing a Record Using Apex
Apex sharing reasons are defined on an object's detail page. Each Apex sharing reason has a label and a name:
- The label displays in the Reason column when viewing the sharing for a record in the user interface. This label allows users and administrators to understand the source of the sharing. The label is also enabled for translation through the Translation Workbench.
- The name is used when referencing the reason in the API and Apex.
All Apex sharing reason names have the following format:
MyReasonName__c
Apex sharing reasons can be referenced programmatically as follows:
Schema.CustomObject__Share.rowCause.SharingReason__c
For example, an Apex sharing reason called Recruiter for an object called Job can be referenced as follows:
Schema.Job__Share.rowCause.Recruiter__c
So, sharing reason must be used which you have defined and that's why it takes API name. It always hold String value.
Refer this documentation: Sharing a Record Using Apex
Apex sharing reasons are defined on an object's detail page. Each Apex sharing reason has a label and a name:
- The label displays in the Reason column when viewing the sharing for a record in the user interface. This label allows users and administrators to understand the source of the sharing. The label is also enabled for translation through the Translation Workbench.
- The name is used when referencing the reason in the API and Apex.
All Apex sharing reason names have the following format:
MyReasonName__c
Apex sharing reasons can be referenced programmatically as follows:
Schema.CustomObject__Share.rowCause.SharingReason__c
For example, an Apex sharing reason called Recruiter for an object called Job can be referenced as follows:
Schema.Job__Share.rowCause.Recruiter__c
So, sharing reason must be used which you have defined and that's why it takes API name. It always hold String value.
answered 2 hours ago
Santanu Boral
29.6k52151
29.6k52151
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f240417%2fis-there-a-typesafe-way-to-work-with-rowcause%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown