Questions tagged [field-level-security]

Each Field within an Object has it's own CRUD (Create, Read, Update and Delete) security permissions applied to it. Field level security settings can make the security applied to a field more restrictive for a User's Profile beyond what Object level security would on it's own, but cannot make the security less restrictive.

Filter by
Sorted by
Tagged with
1 vote
1 answer
2k views

Field Level security disable field visibility

On Opportunity are two Custom Fields Product__c (controlling field) and Product_Type__c (Dependent Field) When i check the field level security on these fields, it is visible for all Profiles. I want ...
GroundToCloud's user avatar
-1 votes
1 answer
779 views

Apex Security rule Check of Soql/ DML [closed]

Trying to add Security Check on SOQL/ DML action in my Apex class. Gone through the following link https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/...
SFDC_Beginner's user avatar
2 votes
1 answer
101 views

Do compound field components have the same access?

Suppose I run the following code: String field1 = 'BillingCity'; String field2 = 'BillingState'; Boolean access1 = Schema.Account.getSObjectType().getDescribe().fields.getMap().get(field1).getDescribe(...
SarcasticSully's user avatar
1 vote
1 answer
4k views

Retrieve and Deploy Custom Fields with Profile FLS settings via SFDX

Is there a simple way to use the sfdx CLI to retrieve and deploy new custom fields from one org to another? Use case: Someone creates new custom fields in Production and want to deploy them easily to ...
Brian Miller's user avatar
  • 5,132
3 votes
1 answer
5k views

How to check edit access for LWC?

I am just going through the Summer 20 Release Notes and found an article - Check User Permissions for Lightning Web Components Here is the link Here I found, to check View Setup permission you just ...
Sahil Malhotra's user avatar
1 vote
1 answer
1k views

Lock a Field on a Record based off of Profile

I have a field on a record that should only be editable by people with a certain profile. I can see that the read/edit is selected correctly under the field level security and I can see under the ...
Olivia's user avatar
  • 3,431
0 votes
1 answer
930 views

Object and Field Permissions - Apex CRUD Violation

I have ran the Apex PMD, In my result in got the security error with the rule ApexCRUDViolation so I'm checking the field-level read permission for the selected field before querying as below. ...
SFDC_Beginner's user avatar
0 votes
1 answer
49 views

Access Aggregated Field Level Security for Offline-first App

We are currently building a page layout renderer for an offline application that would allow end-user to create records and then sync the data once they get access to internet again. We need to ...
jpmonette's user avatar
  • 4,400
5 votes
2 answers
3k views

LWC - Bypass Field-Level Security using Lightning-Input-Field?

Is it possible to create an LWC input form that bypasses field-level security, while still leveraging the powerful UI brought by <lightning-input-field>? Im creating a generic filter component ...
D. Salvadori's user avatar
0 votes
1 answer
110 views

Disable Ability to Edit RecordType

I have a custom object with a Record Type that is read-only on the page layout but I can still make updates to the Record Type on the page. Why is this? I want to make the field un-editable, is there ...
Olivia's user avatar
  • 3,431
0 votes
1 answer
760 views

Deploy FLS settings for standard object's custom field in managed package

I've added a custom field to Activity object for using it during Task creation/updating from Apex code. By default when I deploy my project through SFDX this field has no FLS settings. In the result I ...
SlavaHq's user avatar
1 vote
0 answers
1k views

Can you modify global action fields accessibility by profile?

Is it possible to make fields in a global quick action editable to some profiles and read-only to other profiles? For Example, I want profile1 to have access to editing certain fields, but profile2 ...
Andrew Zhang's user avatar
3 votes
2 answers
1k views

Shortest and most efficient way to query ALL accessible fields of an object

Now that stripInaccessible() and WITH_SECURITY_ENFORCED are GA I wonder what is the most readable and efficient way to do a SELECT all_accessible_fields_for_user FROM AnyObject WHERE Id = ...
Robert Sösemann's user avatar
8 votes
1 answer
1k views

What exception does Security.stripInaccessible throw?

This new security method Security.stripInaccessible both strips out fields that the user has no rights to and will throw an exception if the object-level permissions are being violated. What ...
Keith C's user avatar
  • 135k
9 votes
1 answer
745 views

How to opt out of FLS validation when a SOQL query is run by a trigger?

I have a large Salesforce application with hundreds of SOQL queries. Currently, the code uses Schema.DescribeFieldResult data to determine if the logged in user has rights to each field in the SELECT ...
SeanW's user avatar
  • 672
0 votes
1 answer
231 views

CRUD & FLS - Trailhead

I'm passing the Data Leak Prevention module and have faced some misunderstanding here in this unit Controller: public with sharing class CRUD_FLS_Challenge { public List<Treasures__c> ...
pincet's user avatar
  • 839
1 vote
1 answer
1k views

How to properly use stripInaccessible for PMD ApexCRUDViolation [closed]

On triggers I have some PMD ApexCRUDViolation errors. I see on the winter/spring 20 release notes a new apex function "stripinaccessible" to manage records/fields permissions. Could you have some ...
David-IT's user avatar
  • 135
0 votes
2 answers
199 views

Is there a way to read or set Field Level Security on ScorecardMetric object fields in Apex?

Is there a way to read or set Field Level Security on ScorecardMetric object fields in Apex? I can create a custom field on ScorecardMetric but can't use Apex to set FLS for this field.
Patlatus's user avatar
  • 16k
2 votes
1 answer
217 views

Not able to get Asset Level field permission through SOQL

I have a permission set named abc. Permission to Asset Level field for Asset object is defined like below in abc: I am trying to get field level permissions for abc permission set using the below ...
वरुण's user avatar
3 votes
0 answers
48 views

Is there an alternative solution to prevent other profiles from seeing a certain profile's activites?

I have an original profile A A group of users wanted to go from profile A to a new profile called profile B that is an exact mirror of profile A. Profile B wants to create activities and task, but ...
Cara Cini's user avatar
  • 109
0 votes
1 answer
1k views

Contact Email field not queryable in SOQL

I'm querying contact email field in apex class and saving the return record inside a list. but when I debug the list queried then it does not show the email field. Below is the SOQL which I'm using ...
Jitesh Goel's user avatar
1 vote
1 answer
995 views

Can you restrict edit access to a field once it is populated?

I am working on a Picklist requirement which needs to give Edit access to all by default. Once any value is entered by any user, edit access should be restricted to all except Admin Profiles. Any ...
Samuel Jackson's user avatar
1 vote
1 answer
174 views

FIeld hidden by FLS no longer returns records when search terms match?

When FLS hides a field from a user, the search results would still return the record if the search term matched. https://success.salesforce.com/answers?id=9063A000000DcyUQAS This no longer seems to ...
user75568's user avatar
1 vote
1 answer
551 views

Field Level Security on Email Template Not Working as Expected

I'm trying to hide specific fields in an email template for a specific profile. For this, I removed the field level access for fields I want to hide for the respective profile. After logging in as ...
Ali Noorani's user avatar
3 votes
0 answers
640 views

How to deploy FLS (Field Level Security) for all Objects & Fields in Scratch Org with application source push?

I'm trying to setup DX with Source code in Git and I'm pulling it from there and pushing it into a Scratch org. My Source code has multiple standard/custom objects with fields. But after Pushing code ...
VarunC's user avatar
  • 5,900
2 votes
1 answer
109 views

Storing Encrypted Voucher Codes in Marketing Cloud

We are using a lot of vouchers in our marketing campaigns and usually, vouchers are uniquely assigned to a specific user when they are being issued on the back-end, and therefore no other user can ...
Kat's user avatar
  • 23
0 votes
1 answer
483 views

Extract profile's field level security

Is there a way to get a profile's field level security? I tried an soql query for FieldPermissions object but it's based off of permission sets so if there's no permission set with at least read ...
Peter Luo's user avatar
  • 140
4 votes
1 answer
453 views

Apex Source Scanner flag CRUD/ FLS as security risk for no reason

I've been using FFLIB_SecurityUtils lib to enforce CRUD and FLS in my apex classes. I've no issues when running unit tests, but when submitting my code on Source Scanner for partners, i've several ...
Bryce's user avatar
  • 442
0 votes
2 answers
96 views

having trouble with field accessibility

I have multiple profile and 5 Record type. I am trying to give one record type "Bill to " from Profile " Technical Support User" but when i click on editable and uncheck visible option in PageLayout ...
Ravina 's user avatar
0 votes
1 answer
520 views

How to change field level security of a field across all the profiles?

Is there an option to edit field level security of field across all the profiles at once ?
Subbarao Muppaneni's user avatar
0 votes
1 answer
72 views

Object that contains Field Level Permissions for a Profile

I would like to bulk update the field level access for multiple profiles and multiple fields. What is the name of the sObject that contains field level permissions by profile? "FieldPermissions" ...
Brian Oconnell's user avatar
1 vote
0 answers
43 views

CRUD/FLS Enforcement for configuration tables like FiscalYearSettings

Is Field Level Security enforcement a requirement for querying tables like 'FiscalYearSettings' and 'Period'? or only for tables like Opportunity and Contact. Our app need to display the fiscal year ...
jvrdelafuente's user avatar
3 votes
1 answer
6k views

Enforce Field-Level Security Permissions for SOQL Queries WITH SECURITY_ENFORCED (Confused )

What is the need of WITH SECURITY_ENFORCED? Only benefit is minimal development experience with security and to applications where graceful degradation on permissions errors isn’t required. If ...
cloudZigZag's user avatar
  • 1,366
0 votes
1 answer
53 views

Change Field Level Security on Custom Web Tabs?

I created a custom web tab: SF>Setup>Build>Create>Tabs>Web Tabs>New: And after it's created, when I go to Edit it, I can't change the visibility or field level security. Is this ...
DeathStarSurvivor's user avatar
0 votes
1 answer
103 views

Site profile doesn't appear to have access to FirstName or LastName on Leads

I have created a public site to create Lead records. It seems as though the site's profile has access to the composite Name field but not the FirstName or LastName fields. Eg: //This doesn't Work ...
Jordan Lee's user avatar
1 vote
1 answer
1k views

Is it possible to use Lightning Data Services \ <force:recordData without sharing rules \ field level security?

It is possible to declare a Apex controller class as public without sharing class noSharing { } Is it possible to use Lightning Data Services <force:recordData Without sharing \ field level ...
Robs's user avatar
  • 9,187
2 votes
1 answer
451 views

How to update the FLS using Salesforce Metadata API in a bulk update?

I have a set of fields in the array list which I wanted to give FLS with Read access. I'm using below piece of code to update the field level security using Salesforce API in java language. But the ...
Arosh's user avatar
  • 23
3 votes
1 answer
4k views

Visible vs Read Only?

Opportunity Fields > "Field Label/name" > Set Field-Level Security > What is Visible vs Read OnLy? A Google Search Revealed: Visible : If you check the "Visible" checkbox, that field will be ...
Guest Guy's user avatar
2 votes
2 answers
2k views

How to make custom object record only visible to certain users based on field checkbox

So I have a custom object in my org called Promotion Events. I would like to add a field called 'Private' that is a check box, and if it is checked and the event is created, this event(Promotion Event ...
Storm Martinous's user avatar
1 vote
2 answers
204 views

How do I determine by Apex code if Custom Field allows setting Field Level Security and if can be edited?

To assign correct FLS permissions in bulk for a given profile I need to know which fields are readonly and which fields support Field Level Security. I see that there is field IsFlsEnabled in ...
Patlatus's user avatar
  • 16k
2 votes
1 answer
466 views

How to deal with users without permission while using Lightning Data Services?

To be more specific, I have the following scenario that just happened: I developed a component on a sandbox (development environment). This component uses force:recordData to retrieve some field data ...
Renato Oliveira's user avatar
4 votes
1 answer
390 views

How do I find out if a field is updateable by the System?

I am running a batch process that is marked without sharing. I would like to to take one course of action if the batch process can update a particular field, and another if not. For example: if (...
Charles Koppelman's user avatar
0 votes
1 answer
1k views

Can we change FLS for required field?

I am aware of following: ProfileFieldLevelSecurity ProfileFieldLevelSecurity represents the field level security for users assigned to a profile. In API version 30.0 and later, permissions for ...
sfdcnoob's user avatar
  • 101
4 votes
1 answer
329 views

Field Level Security for new fields

When creating new fields, some profiles are checked by default on page load. How are these profiles determined ?
david raj's user avatar
  • 623
0 votes
1 answer
17 views

A user is able to see Sharing setting in setup without having "managed Sharing "permission

A user is able to see Sharing setting in setup without having "managed Sharing permission" either through profile or Permission set,how can he have access ,Am i missing some configuration.
Prabhat Jha's user avatar
1 vote
2 answers
3k views

How to hide a field from a specific profile?

I have a Pipeline object, in which I have a Members text box that I need to hide from Sales users. I have made the configuration as shown: However, when I login as a Sales user, I still see the ...
ohseekay's user avatar
  • 195
0 votes
1 answer
1k views

Querying fields of a particular pagelayout w.r.t Profile and Object

Can we achieve SOQL for this below scenario If I provide Object Api Name Page Layout Name Profile Name It should return me list of available fields in the Page Layout, but not all fields present ...
sai kiran's user avatar
0 votes
0 answers
156 views

Hiding Custom Setting data on front-end and through postman

We are using angular for front-end and Salesforce is being used for maintaining database. REST APIs have been written on Salesforce to communicate and fetch data to front-end. A custom profile has ...
Salesforce Learner's user avatar
1 vote
1 answer
346 views

Changing Field Level Security for Connection User in Salesforce to Saleforce

We are using Salesforce to Salesforce to share an object (Object A) with the target org. In the target org, the trigger for the object A is invoked and based on the received record, tries to update ...
Payam Izad's user avatar
0 votes
1 answer
145 views

Set field accessibility of Custom Setting's field

Can we set field level security / field accessibility of a Custom Setting's field?
Salesforce Learner's user avatar