Do we need to check FLS for Record Id field in apex?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
We are submitting our application for Security review so we have to check FLS/CURD so we have a query like below.
Account ac = [SELECT id, Name From Account limit 1];
so do we need to check isAccessible()
for Id
field here? I know we have to check for Name field but not sure do we really need to check same for Id
field?
apex security-review
add a comment |Â
up vote
1
down vote
favorite
We are submitting our application for Security review so we have to check FLS/CURD so we have a query like below.
Account ac = [SELECT id, Name From Account limit 1];
so do we need to check isAccessible()
for Id
field here? I know we have to check for Name field but not sure do we really need to check same for Id
field?
apex security-review
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
We are submitting our application for Security review so we have to check FLS/CURD so we have a query like below.
Account ac = [SELECT id, Name From Account limit 1];
so do we need to check isAccessible()
for Id
field here? I know we have to check for Name field but not sure do we really need to check same for Id
field?
apex security-review
We are submitting our application for Security review so we have to check FLS/CURD so we have a query like below.
Account ac = [SELECT id, Name From Account limit 1];
so do we need to check isAccessible()
for Id
field here? I know we have to check for Name field but not sure do we really need to check same for Id
field?
apex security-review
apex security-review
edited 2 hours ago


Oleksandr Berehovskiy
6,50611532
6,50611532
asked 2 hours ago


Ravikant Kedia
6561411
6561411
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
Let's do an interesting thing here:
Run below code in the developer console:
List<Account> acc = [Select name from Account];
System.debug(acc[0].id);
You will see that debug prints the Id of the account even when we didn't retrieve it.
Id field is generally included in the soql implicitly.
So i don't think it anyhow matters to check permission on ID field, It is not required and would only add the ambiguity.
Rather you should first check access on object itself then on it's fields.
add a comment |Â
up vote
0
down vote
As per my research ID field is not available for set FLS at the profile level. Then it not required to check isAccessible() prior to query. Further, if you have read access to object ID field is accessible by default.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Let's do an interesting thing here:
Run below code in the developer console:
List<Account> acc = [Select name from Account];
System.debug(acc[0].id);
You will see that debug prints the Id of the account even when we didn't retrieve it.
Id field is generally included in the soql implicitly.
So i don't think it anyhow matters to check permission on ID field, It is not required and would only add the ambiguity.
Rather you should first check access on object itself then on it's fields.
add a comment |Â
up vote
2
down vote
Let's do an interesting thing here:
Run below code in the developer console:
List<Account> acc = [Select name from Account];
System.debug(acc[0].id);
You will see that debug prints the Id of the account even when we didn't retrieve it.
Id field is generally included in the soql implicitly.
So i don't think it anyhow matters to check permission on ID field, It is not required and would only add the ambiguity.
Rather you should first check access on object itself then on it's fields.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Let's do an interesting thing here:
Run below code in the developer console:
List<Account> acc = [Select name from Account];
System.debug(acc[0].id);
You will see that debug prints the Id of the account even when we didn't retrieve it.
Id field is generally included in the soql implicitly.
So i don't think it anyhow matters to check permission on ID field, It is not required and would only add the ambiguity.
Rather you should first check access on object itself then on it's fields.
Let's do an interesting thing here:
Run below code in the developer console:
List<Account> acc = [Select name from Account];
System.debug(acc[0].id);
You will see that debug prints the Id of the account even when we didn't retrieve it.
Id field is generally included in the soql implicitly.
So i don't think it anyhow matters to check permission on ID field, It is not required and would only add the ambiguity.
Rather you should first check access on object itself then on it's fields.
answered 1 hour ago
Mr.Frodo
4,7831930
4,7831930
add a comment |Â
add a comment |Â
up vote
0
down vote
As per my research ID field is not available for set FLS at the profile level. Then it not required to check isAccessible() prior to query. Further, if you have read access to object ID field is accessible by default.
add a comment |Â
up vote
0
down vote
As per my research ID field is not available for set FLS at the profile level. Then it not required to check isAccessible() prior to query. Further, if you have read access to object ID field is accessible by default.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
As per my research ID field is not available for set FLS at the profile level. Then it not required to check isAccessible() prior to query. Further, if you have read access to object ID field is accessible by default.
As per my research ID field is not available for set FLS at the profile level. Then it not required to check isAccessible() prior to query. Further, if you have read access to object ID field is accessible by default.
answered 7 mins ago


chamika
114
114
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f234009%2fdo-we-need-to-check-fls-for-record-id-field-in-apex%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password