Questions tagged [apex-sharing]

Granting permission to User/Group of Users via Apex.

Filter by
Sorted by
Tagged with
9
votes
1answer
749 views

Schedule and Run a Report as an specific User from Apex

Background What we are trying to accomplish is to run daily some specific reports as an specific user. So far From a lightning component we are allowing the user to select a reports list. Once the ...
8
votes
1answer
5k views

FIELD_INTEGRITY_EXCEPTION: field integrity exception: unknown (invalid user or group: 005XXXXXXXXXXXX)

I've a object called myobject__c. This object is private in OWD Setting. Now when admin create a new record of this object then I want to share this record with a user(community user). For this I've ...
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 ...
2
votes
1answer
569 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 ...
13
votes
2answers
7k views

Communities Sharing Rules with Partner level access

So Im a little confused about the best way to share content within a salesforce community. We have a number of custom objects with content owned by community members, and our hope is to create "...
2
votes
3answers
390 views

Apex Based Sharing - Lead Share object

I am working on a requirement to achieve the below: Whenever a lead is created by a user: Check if that user is Rep Type (field present at user level), then add that user to Lead Share object with ...
1
vote
1answer
176 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 ...