You want to grant additional sharing access to a specific user or group in the scontrol, right?
If so, check out the AccountTeamMember and AccountShare objects in the API docs: http://www.salesforce.com/us/developer/docs/api/index.htm
But note that the SControl will execute with the same permissions as the logged in end-user. So that user might not have the privileges to grant additional access to the Account. So there might be a permission issue there.
Another option is to use Apex Code which runs as System Admin by default and you could grant additional account access.
With Apex, you still will need to insert or update records in the AccountShare object to grant additional access. More documentation on the AccountShare object: http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_objects_accountshare.htm
Code example: AccountShare aShr = new AccountShare(); aShr.AccountId = <specify the proper account id here to grant access to>; aShr.UserOrGroupId = <specify the user id or the group id to grant access to>; aShr.AccountAccessLevel = <set access level>; aShr.OpportunityAccessLevel = <set access level>;
aShr.CaseAccessLevel = <set access level>;
insert aShr;
Additionally, you could "webService" enable the apex method and call it from an SControl. That way you get around the user permissions issue of the Scontrol running as the logged-in user. Here is more information on that: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_and_ajax.htm
If so, check out the AccountTeamMember and AccountShare objects in the API docs: http://www.salesforce.com/us/developer/docs/api/index.htm
But note that the SControl will execute with the same permissions as the logged in end-user. So that user might not have the privileges to grant additional access to the Account. So there might be a permission issue there.
Another option is to use Apex Code which runs as System Admin by default and you could grant additional account access.
Yes, Albert. I want to give additional sharing access to the specific user.
So, my understanding is there is no way to do it in S-control. Right?
Is there any Apex sample code I can use to get the additional user access?
Code example:
AccountShare aShr = new AccountShare();
aShr.AccountId = <specify the proper account id here to grant access to>;
aShr.UserOrGroupId = <specify the user id or the group id to grant access to>;
aShr.AccountAccessLevel = <set access level>;
aShr.OpportunityAccessLevel = <set access level>;
aShr.CaseAccessLevel = <set access level>;
insert aShr;
Additionally, you could "webService" enable the apex method and call it from an SControl. That way you get around the user permissions issue of the Scontrol running as the logged-in user. Here is more information on that: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_and_ajax.htm