In salesforce security review am getting a error FLS create which is for ID field. so when a FLS create error occurred, validated the isCreateable or isUpdatebale for update condtion.enter image description here

Here how to validate the error, When validated isCreatable for ID field error didn't occur but the record is not inserting. (cant check isCreatable for ID field right?) How to manage both the FLS create issue and ID field issue.

And can please tell me should I validate both isCreatable and isUpdateable for upsert operation ?

1 Answer 1


The Security Scanner tool is not as great when it comes to Apex.

  1. I would ignore the reported error and implement the right way logically which is - Don't check Id isCreateable().

  2. Yes, you should validate both isCreatable and isUpdateable for Upsert operation.

  • The Id field will always have isUpdateable as false.
    – Adrian Larson
    Commented Apr 11, 2018 at 0:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .