Sharing enables record-level access control for all custom objects, as well as many standard objects.

learn more… | top users | synonyms

6
votes
3answers
75 views

Does “with sharing” only apply to 1st entry point of code?

I was watching an old Dev 501 video today (#4 Classes & Objects) in which the instructor said profile based sharing rules were only checked at the entry point where apex code begins it's ...
9
votes
2answers
339 views

How does lighting authentication work?

I'm new to Salesforce. But I have quite experience with modern SPA frameworks (angular and mean stack). I'm experimenting a bit with Lighting framework (=aura components). How does the ...
1
vote
1answer
34 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 ...
1
vote
0answers
15 views

In what part of execution order are Owner Based Sharing rules evaluated?

Salesforce do specify that Criteria Based Sharing is evaluated quite late in the execution context, but the documentation makes no reference to Owner Based Sharing: From ...
0
votes
1answer
18 views

Share record(s) based on user custom field?

I have a custom field on my user (customId) that corresponds with the value in a custom field on my object (customId as well). I'd like for a user with the customId of A2 to only see records where ...
0
votes
1answer
15 views

Need to share a record with a Community User and all others in their account. Can this be done without code?

I have a Custom Object X that has Org Wide Defaults of "Private". The owners on the records are always internal users. We would like to share the object with customers that belong to the account for ...
0
votes
2answers
41 views

Private or public read-only Organization Wide Settings for custom object?

I would like to know about how can I distinguish whether a Custom Object OWS is set to Private or Public read-only via Apex. As far as I know and find referenced here Get object sharing setting on ...
0
votes
0answers
30 views

Get 'grant access using hierarchy' value in Apex

My question is the next one: Is it possible to get through Apex code the value of the checkbox besides every custom object which marks the 'grant access using hierarchy' option in the Sharing Settings ...
2
votes
1answer
27 views

Using System.runas in Non Test Mode

I have a special requirement to protect a custom object from admins modifying through all channels like API, workbench, standard platform feature etc but should be able to view through all channels ...
2
votes
1answer
15 views

If object is private but its lookup allows Read, what will happen?

What will be the access level for the lookup field in these 2 scenarios: MyObject is private, object-level permissions allow Read, and lookup to MyObject allows Read Same as 1 but object-level ...
1
vote
0answers
20 views

Controlled By Parent (OWD)

Order has lookup to Account,Contact,Contract,Quote and Order and when you set OWD of Order object as Controlled by Parent and there is no Master-Detail relationship on Order Object then who is the ...
2
votes
1answer
40 views

Mapping function for apex sharing

So I'm trying to create a function that allows you to create a sharing rule through Apex with any Object. Is there a way to generalize this so I don't have repeating code? From what I understand the ...
0
votes
1answer
19 views

Internal Case is automatically shared with external contact if “Contact Name” field is populated with the external contact

Internal case would be shared with an external user once that user has been added as the "Contact Name" on the case even though the intention was not to share the case with the external user. Is there ...
1
vote
1answer
19 views

Data-driven sharing rule?

Is there a way to set up a sharing rule that shares a record with a user who is specified in a user field on the record being shared?
0
votes
1answer
30 views

Integer declaration

I have below method in a public with sharing class. In the method, I need to use an integer but unable to declare that. Can someone please help me in integer declaration here? Snippet: public with ...
1
vote
1answer
19 views

Salesforce owner and different sharing options for integration scenarios

If we have an account from SAP system, this account don't have an owner, then we insert this account into salesforce the owner will be the default owner(current operation user). In the next day, maybe ...
1
vote
0answers
28 views

Updating account on opportunity causes owner sharing record get deleted

Workflow updates account owner to generic user 'SFDC Admin' when ever account are created by users. with that said.. If any user is updating account on opportunity, it is resulting in deletion of ...
0
votes
0answers
17 views

Access information against the actual object

I wanted to know what is the best practice of getting access information of a custom sObject? For example I have customized Account's field CustomObjectID Lookup(Custom Object). I have such Sharing ...
2
votes
1answer
43 views

Share a contact with particular user using apex managed Sharing

In my Org. OWD setting for Account Object is Private and for Contact it is Controlled By Parent. So whenever I want to share particular record I am creating an Object of ContactShare and try to update ...
0
votes
0answers
25 views

Trigger to automate Account Teams not setting sharing rules correctly

I've developed the following trigger to automatically create an Account Team member when an Account is assigned to certain profiles. The goal is to continue to provide 'ownership' of an Account to a ...
1
vote
2answers
39 views

Insufficient Privileges error on record detail in Partner Community

I've got Partner Community Users (not High Volume) and I want them to see a Contract record. I recognize there is no ContractShare and his visibility must be absorbed from the Account The Sharing ...
1
vote
1answer
26 views

Access “Anyone with link” properties (and link) using REST API

I have an attachment with "Anyone with link" sharing configuration. How can I retrieve (or construct) the actual sharing URL using the rest API? E.g., I have an attachment with id: 069240000009bdU ...
0
votes
1answer
53 views

Data Access restrictions to Salesforce objects via Apex Web Service

I'm going through this article : https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_web_services_methods_exposing.htm Have few questions regarding access to field/objects/record by ...
0
votes
0answers
18 views

Sharing Task with Public Group

I have a Public Group of users called IT Admins. On a specific scenario, a Task will be assigned to any one user belonging to this group. I want the entire group to be able to edit this Task. I will ...
0
votes
1answer
25 views

Can not create sharing rule on sandbox [closed]

I have a sandbox and production environment set up. Sandbox is develop type. There is a sharing rule on one of the objects (Survey__c) on Production. I took refresh of sandbox and now I am trying to ...
1
vote
2answers
42 views

I need to check every owner of an object involved in a trigger permissions

I have an object called Albaran__c, (it's set on private sharing mode). I have a trigger that shares every record involved on the trigger with the owner of the Account we do reference on the field ...
0
votes
0answers
48 views

insufficient privilege on changing opportunity owner despite sharing rule

Hi i have our OWD setup for Opportunity object = Private then we have this sharing rule: Owner in Role: Sales Manager shared with owner in Role:Sales Rep (Read/Write) now our Sales Manager created ...
0
votes
0answers
34 views

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY when setting custom field on a Task

I have a managed package with post-install script that executes a batch job to initialize a custom field on the Task object that is defined by package. It has worked fine for me in the developer ...
0
votes
0answers
20 views

Fetch “Grant Access Using Hierarchies” via SOAP/METADATA API

How can I get “Grant Access Using Hierarchies” of Organization-Wide Defaults in Salesforce Sharing Settings. I stumbled upon this answer and Org-Wide Defaults is no longer in the unsupported list. ...
4
votes
1answer
71 views

Use runAs to unit test class without 'with sharing' keyword

There is class without 'with sharing' to ignore sharing and delete sobject in system context. I am writing unit test to verify the behavior that execution of this code will definitely delete this ...
0
votes
1answer
27 views

Mixed Sharing Model

I have a challenge that I can't solve. We have 2 custom objects; Providers and Prescriptions. There is a master-detail relationship between them. Our users are granted access to individual providers ...
1
vote
1answer
110 views

Portal users cannot run User object reports - insufficient privileges

I have a Customer Community Plus site with portal users using Customer Portal licenses. I want the portal users to run User object reports so they can see last login, etc. Portal users are still ...
1
vote
2answers
34 views

Contact Deletion - Insufficient access

Our org settings for Account and Contact is Public Read/Write. We have a user with custom profile. That profile additionally has View All on Contact and Account (but Modify All is not selected). ...
0
votes
1answer
16 views

how to hide a record in hierarchy model salesforce

I have a hierarchy model where 1 manager with 2 leads officer (A, B) and 2 sales person under each lead officer. Now my client need to hide records of A lead officer from manager. How can it be ...
1
vote
1answer
46 views

Access OWD (internal and external) in Apex?

Is it possible to get the Internal OWD and External OWD of custom objects in Apex? Is there any API or object from which it can be retrieved?
1
vote
2answers
29 views

How can I add a role and use apex managed sharing all at once?

Question is in the title. For context, when a certain record is added, we would like to create a role (named after that record) and share it with that newly created role. Because of that, the flow ...
0
votes
0answers
23 views

STRANGE!!! Not able to create new opportunity record from UI and class

getting error while creating record from UI in salesforce.. Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of ...
0
votes
1answer
41 views

Can sharing rules be based on opportunity roles

We are looking for a way to create role based sharing based on opportunity roles. We have a use case that if we try to use manual sharing, even with apex triggers to automate the manual aspect, we ...
0
votes
2answers
36 views

Read-only sharing rule is not restricting editing from inline-editing, whereas from API it is getting restricted

I have 2 user groups K1 and NK1. NK1 are managers of K1.Custom object A_S has OWD private, with grant access. There is a sharing rule to give read-only access to K1 users of NK1 user's records. It ...
0
votes
1answer
42 views

Selectively Deleting sharing rules

Hi guys I am trying to delete sharing rules on a custom object (say myCustOb__cj) based on if the user is a portal/community user or an internal user. If the user is a portal user then delete the ...
0
votes
0answers
14 views

Sharing Case Information within Partner Organizations

Does anyone know of a way to override the standard sharing roles for Portal Users (read/write to Account, read to Opportunity, and private to Cases) for all Accounts? I found a way to do this through ...
0
votes
1answer
33 views

Record visibility restriction to User irrespective of Ownership

I have an Object structure like Parent - Child relationship. Where in i just need to display records where logged-in user is lookup in Parent record. Leave Balance is Parent Object and Leave Request ...
1
vote
1answer
352 views

Remove Edit Delete Link from Standard Related Lists/Views

We have a manage package, We want all the custom objects to be in read only mode for all the user including System Admin, i.e Neither user should be able to edit/delete the records nor view ...
1
vote
1answer
99 views

How to share Contact Record without linking Account Record

I have few Contact Record and I want to share it with other Groups. I have set the Contact Sharing rule and also set the Object level access for the profile. Thing is, I am able to share Contact ...
1
vote
3answers
84 views

Updating Record access Level

On Account object - OWD as Private I have a requirement consist of Two roles as 1. Process Owner - Creator of accounts 2. Manager Team - Verification team having access to those accounts We have ...
0
votes
1answer
50 views

Apex SOQL doesn't honor 'with sharing' for Pricebook2

My org is running some apex code that pulls objects and passes them to a mobile app. The apex code in question is designed to be run as the sales rep that is logged in via the app. For some reason ...
0
votes
0answers
29 views

Chatter File appearing in sysadmin UI even though marked as private in Personal Library

One of our apps uploads files that get stored in Chatter Files, (ContentVersion). Fields get set to Origin 'H' and PublishStatus 'R'. According to docs: Origin of 'H' - meaning "This is a Chatter ...
0
votes
0answers
81 views

Sharing Rules Limits Questions

Question 1 - Can the number of sharing rules per object be increased? ​As per the limits guide: 300 sharing rules per object 50 criteria sharing rules per object Question 2 - what's is the limit on ...
1
vote
1answer
42 views

Ownership of custom object record is not allowing user to view related account

We'd like users who own records for a custom object (Projects) to be able to click from the Project record to view the related account. This works perfectly in opportunities, so I'm wondering why it ...
2
votes
1answer
69 views

Testing Communities Before Publishing

What is the best way to test your Community before publishing? I want to see if Field-Level Security and Sharing Sets are working correctly for the Community User role. For example, my profile has ...