Questions tagged [apex-managed-sharing]

Apex Managed Sharing is the act of granting a user or group of users permission to perform a set of actions on a record or set of records. Sharing access can be granted using the Salesforce user interface and Force.com, or programmatically using Apex.

Filter by
Sorted by
Tagged with
20
votes
2answers
12k views

Sharing access to partner community users based on record owner

Im trying to write what feels like it should be a simple Apex sharing rule but not having much luck. Basically I want partner users to be able to see all "customers" (custom object) owned by customer ...
8
votes
1answer
6k views

revoking apex managed sharing permission

I'm using apex managed sharing to grant permissions very similar to how it is done in this example trigger: http://wiki.developerforce.com/page/...
5
votes
2answers
2k views

Can one implement a Mutex / Lock / Semaphore in Salesforce?

I have multiple processes (teams of users) that need to mutually exlusive work on the sames data records in Salesforce. Is there a way to simulate a kind of Mutex or Semaphore in Salesfore (e.g. ...
7
votes
1answer
2k views

Apex Managed Sharing for detail object

I am looking for a solution where I need to implement Apex Managed Sharing for a detail custom object whose master object is a standard object - in my case it is account. I have an object say ...
5
votes
2answers
2k views

Is is possible to grant delete permissions using apex managed sharing?

I have Custom_Object__c with: Org-Wide Default Settings as: Private Object Permissions in the user Profile: Create, Read, Edit, Delete. I have a small development in Apex that is creating some apex ...
7
votes
2answers
6k views

Using Apex Managed Sharing to share an opportunity

Here's the use case. When a lead is converted to an Opportunity, I want to automatically share the opportunity with the previous owner of the lead. This is needed because upon conversion, the ...
2
votes
1answer
694 views

Why can't I create this AccountShare in a community?

Here's the scenario. Customer Community user creates a record. A trigger fires, calls into a without sharing class which inserts an AccountShare record. AccountShare is not accessible to community ...
3
votes
1answer
550 views

APEX Sharing stopped working in community

We had a small widget that allowed customers to share records that were set to a private sharing model in our community. Everything was rather simple and it would simply allow them to select users ...
3
votes
1answer
1k views

Sharing Records

I have an org that was recently updated to API 32, which broke some triggers that create Sharing Records. This code worked previously to the update to API 32. public void OnAfterObjectInsert(List<...
4
votes
1answer
323 views

Apex Managed Sharing as customer portal user if class has “with sharing” modifier

Schema.getGlobalDescribe().get() on a custom Share object is returning null when the user is a CP user and the class has the with sharing modifier even though the custom object has an OWD of private. ...
3
votes
2answers
7k views

Why i am getting “Field is not writable: OpportunityShare.UserOrGroupId” compile time error

I am getting compile time error while trying to assign userId to opShare.UserOrGroupId field. I am not sure what is wrong in it - List<OpportunityShare> grantAccessUpsertLst = new List<...
1
vote
1answer
248 views

Want to share custom object records with Partner Community Users based on User's custom field

My custom object and User object, both are having a custom field named as State, I want to share custom object records with only those users who match with the State of the custom object's record. I ...
1
vote
1answer
130 views

Is is possible to grant delete permissions using apex managed sharing in Summer '17?

I tried to follow the Answer from this Question: Is is possible to grant delete permissions using apex managed sharing? I have an Apex Managed Sharing with 'edit' for the public group the user is in ...
1
vote
1answer
2k views

Issue deleting object

I have a strange problem that I cannot figure out. I have a database model that looks like this: The A object is shared private in the org. User A creates record 1 and will become the ...