The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0
votes
1answer
18 views

Possible to Customise Groups?

It it possible to: 1) Add new Type values for Groups? This is a picklist field. 2) Customise the page layout for Public Groups? 3) Create a text field for (Public) Groups? The Group object doesn't ...
0
votes
1answer
33 views

Update OWD using metadata for custom objects

Requirement- I have many custom object whose OWD I need to change.Almost 50 managed package Objects are there which i need to consider .Is this possible to do it by metadata (package) or what is the ...
1
vote
0answers
11 views

SFDX push with private accounts error for AccountShare objects

we are trying to use SFDX for continuous integration in one of our projects. We are setting the account sharing model to private, and from code add some manual sharing on accounts. However in an SFDX ...
1
vote
0answers
17 views

Share record on basis of sharing of lookup object [closed]

We have Quote object looking up to opportunity in our Org. We want to set sharing of Quote object to Private. The sharing of the Quote record should be same as of opportunity. We are planning to ...
-1
votes
1answer
33 views

How to Unshare Record By using shared date

I want to Unshare records by Query which I shared 1 month ago. List<CustomObject> rec = [SELECT Id, CreatedDate FROM CustomObject WHERE CreatedDate <Whatever Date]; How I can get Shared ...
0
votes
2answers
212 views

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY on Apex Sharing Insert

I'm getting this exception when inserting to the Share table of a custom object. I've mirrored the code on document here: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/...
1
vote
2answers
18 views

Edit Default Sharing Settings of a Share Object

As per the title I am wondering if it is possible to edit the default sharing settings for a particular Share object. For instance I would like to give a group of users edit access to the CaseShare ...
1
vote
1answer
44 views

Salesforce Managed package can't push

I can't push managed package bcoz I've deleted few unwanted classes from it and rebuild the package now whenever I try to push this new uploaded package it went fail and ask me for deleted class bcoz ...
1
vote
0answers
132 views

Apex Sharing of Case to All Internal Users

I am having an issue whereby I have created an Apex method to create a CaseShare record for a particular case. The manual share record provides Read access to the standard group "All Internal Users: ...
0
votes
0answers
35 views

Permission Error when Auto-Sharing Salesforce File with Apex Trigger

I am trying to create an Apex trigger that automatically shares an attached Salesforce File with a user related to the record upon which the File was uploaded. I believe I have created a working code ...
0
votes
0answers
22 views

User cannot see “Shares” relationship on Case [duplicate]

I'm trying to use Apex Managed Sharing to create share records when a record is created, but I'm running into a bit of an issue when Customer Community Plus Login Users create the records... A user ...
3
votes
1answer
150 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 ...
2
votes
0answers
180 views

Delete __Sharing object

I'm receiving the following error: TR09_MasterServiceAgreement: execution of AfterInsert caused by: System.DmlException: Delete failed. First exception on row 0 with id 02c1800002Lir2PAAR; ...
4
votes
2answers
110 views

Is there a typesafe way to work with rowCause?

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 ...
2
votes
0answers
39 views

Apex sharing insert

We are now investigating some performance issues for the client and trying to speed up their processes. One of the time consuming parts is apex sharing that we have there. I am pretty sure that some ...
6
votes
3answers
244 views

Question related to sharing

Below is our scenario We have a custom case object. where ownership is based on queues. Users are assigned to queues and any user part of a queue gets access to all the cases assigned to the ...
1
vote
0answers
23 views

Sharing records without the ability to report the same

We have the below scenario for the partner users: 1) They should be able to view their own data. (they are not the owners of the record, but it is explicitly shared to them). 2) The should ...
-2
votes
1answer
31 views

Sharing Rule to share custom Obj [closed]

I haven't worked on Sharing Rule Before can anyone please help me. I want to share 'Story' custom Object. When Share checkbox is checked, share Story record with Role and Hierarchy - Exec Director ...
1
vote
2answers
266 views

What are the Apex Managed sharing best practice for a large number of records

I have a question about Apex Managed Sharing best practices. We have a use case where we would need to create thousands of Apex Sharing records for each user. I was wondering would it be better to ...
1
vote
1answer
50 views

Record Sharing Salesforce

Below trigger is giving error while creating sharing records, can some suggests where is the issue. Sharing setting is set to private for external user on this object. Error: AccessLevel (trivial ...
2
votes
2answers
255 views

Create Custom Object Share record as Community User

Similar to this question, I cannot create a CustomObject__Share record as a Community User (Customer Community License). Taking the advice provided there, I have created a Share__c object that ...
1
vote
0answers
368 views

Apex case sharing for customer community users

I'm hoping someone can help me understand the best way to approach the following requirement? Requirement: allow community users on different accounts to share cases with one another. Current Setup: ...
0
votes
0answers
153 views

How the Custom Apex Sharing works in salesforce?

In my org, Case OWD is Private and Case has two child objects (Transaction1 and Transaction2) whose OWD is Private too. Transaction-1 and Transaction-2 object has lookup relationship with Case. I ...
1
vote
0answers
22 views

Is there a way to remove sharing of records implemented via apex? [duplicate]

I want to rollback the sharing of records implemented by creating OpportunityShare records via apex code. Initially, I had assigned specific users access to the Opportunity records, but on testing it, ...
5
votes
1answer
315 views

Recalculating Apex Managed Sharing

I am studying "Apex Managed Sharing" but I have a problem with "Recalculating Apex Managed Sharing". The Apex Developer Guide says: Every time a custom object's organization-wide sharing default ...
1
vote
1answer
39 views

Fate of unsupported Lightning features?

Has Salesforce has said anything (officially or unofficially) about whether or not Lightning will support the below features that currently you have to switch back to Classic to manage? I have not ...
2
votes
1answer
772 views

Sharing records from Customer Community user to Customer Community Plus users

In our org we have a customer community with both Customer Community (Login) license users and Customer Community Plus users. We want to give those users access to some objects related to their ...
1
vote
1answer
181 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 ...
0
votes
1answer
84 views

Can't remove Apex Sharing reason from managed package. Why?

In my managed package I had a CustomObject__c with an Apex Sharing reason. I now want to delete the object from the package. But I can't. Because I need to delete the Sharing reasons before. Which I ...
3
votes
1answer
194 views

How can we maintain access to the creator a Case at all times, even when its owner has been changed to Queue

I had written a Workflow rule based on which a case gets auto-assigned to a "Customer Service Representative" queue. Now the problem is that as soon as the case is created, the creator gets ...
0
votes
1answer
571 views

Check for login User permission access in Lightning

Currently I am trying to share a record manually using Lightning components. As a owner Admin is able to share a record with User A User A is not able to share a record with User B Our requirement ...
0
votes
2answers
137 views

How to pull the Share table from a Lead and insert it into a Contact when the lead gets merged to that Contact

When a lead gets converted, if it has a contact with the same name, it gets merged using Dupeblocker. The share table from the lead gets lost, I'm trying to copy that table and insert it into the ...
0
votes
1answer
411 views

Unable to insert record into AccountShare object using High Volume Portal User

Scenario: We have a client portal enabled using Napili communities. They use ‘Customer Community Login User’ license. We also have another set of users who use are supervisors and they also use the ...
1
vote
1answer
646 views

What is a “sharing group associated with a role”

I'm working with Apex Managed Sharing and in the developer guide here for a "UserOrGroupId" it mentions: a public group or a sharing group associated with a role I can't find anything to explain ...
1
vote
1answer
97 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 ...
0
votes
1answer
47 views

How to share access of a private child to same access as parent, without using master-detail?

Given my object relationship below, how (without using master-detail between media and account) would I solve the need to share Media__c in a private Media__c model such that access to Media mimics/...
0
votes
1answer
71 views

Opportunity records are shared with users automatically

We are using a Visualforce page for creating Opportunity records. The Opportunity OWD is set to Private.We have salespersons field(users) being set on Opportunity Page while creating Opportunity. The ...
2
votes
2answers
1k views

Guest User (Site) Access to a specific standard record

By default Salesforce allows the guest user to be granted 'Create' and 'Read' sharing access to standard object records (for the purpose of this question, let's consider Account). It makes sense that ...
0
votes
1answer
405 views

Unable to deploy Apex-based sharing code due to sObject Type not Supported

I am trying to deploy some Apex-based sharing. Everything works fine in sandbox and code is 100% covered. I have a set of contacts (with a related User field) and a set of Project Task records (a ...
2
votes
1answer
578 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 ...
0
votes
0answers
171 views

How to manage sharing rules in apex?

I am currently learning Salesforce. And I`ve got the task on courses about apex managed sharing rules. I need to use 3 standard objects - Account, Contact, User and 3 custom - Terr(as a territory), ...
1
vote
0answers
236 views

Question on Lead record sharing with Partners in the Partner Community

Use case detail: Partners can create Leads and view Leads that are assigned to the Partner thru the Partner Community Partner creates a Lead (e.g. Dan Cook) Partner has visibility to the Lead due ...
4
votes
1answer
454 views

What exactly happens when a share record is inserted?

We have apex sharing all over our project. When we developed and tested it in a Developer sandbox everything went nice and smooth. Now, in full sandbox this apex sharing seems to be the bottleneck. It ...
0
votes
1answer
669 views

Creating sharing rules through apex not manual sharing

Is it feasible to create sharing rules through apex , not manual sharing of records? Can someone please let me know if that can be done?
0
votes
1answer
296 views

Partly sharing detail records of a master-detail relationship

In our data model, we have several objects that are details of account (master-detail) relationship. I want a profile to have access to the records of Object A and B if they are the owner of the ...
3
votes
1answer
19 views

Is there any possibilty in salesforce to access higher role persons records

In salesforce , by any means, can we provide access for lower profile persons to access higher profile persons records. Whether can we do this by using "Apex Based Sharing" ?
0
votes
1answer
29 views

Will there is always one record exist for share?

i fetch the share record using below soql List<sObject>shareList = new List<sObject>(); For( Test1__c primaryRecord : [select id , (select id from shares) from Test1__c]) Then i am ...
0
votes
2answers
471 views

Best way to share among multiple Roles/Profiles

Scenario: I have a requirement where I need to share records of some custom objects with users whose role could be anything say like region wise sharing. What could be the best way, till now in my org ...
2
votes
1answer
103 views

Advice regarding Apex Sharing on many objects

I developed a complex app with 25 objects all related to a single person. I initially developed the relationships as a Master-Detail hierarchy however it became apparent that the not being able to ...
1
vote
1answer
142 views

CaseShare created by partner record disappears

I am trying to beat this old problem of being unable to share partner cases with it's sibling partner users. I've implemented Apex managed sharing, but facing odd behaviour. I can see in debug log ...