Do we need to check FLS for Record Id field in apex?

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question





























    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?










    share|improve this question

























      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?










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago









      Oleksandr Berehovskiy

      6,50611532




      6,50611532










      asked 2 hours ago









      Ravikant Kedia

      6561411




      6561411




















          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.






          share|improve this answer



























            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.





            share




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "459"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              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






























              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.






              share|improve this answer
























                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.






                share|improve this answer






















                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 1 hour ago









                  Mr.Frodo

                  4,7831930




                  4,7831930






















                      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.





                      share
























                        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.





                        share






















                          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.





                          share












                          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.






                          share











                          share


                          share










                          answered 7 mins ago









                          chamika

                          114




                          114



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              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













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              One-line joke