function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ankur Saini 9Ankur Saini 9 

Getting error when I send my code for security review : isCreatable() and isUpdatable()

User-added image
Best Answer chosen by Ankur Saini 9
Abhilash Mishra 13Abhilash Mishra 13
Hi Ankur, 
I understand your concern, in Apex and Visualforce. Not All the Time CRUD and FLS are Respected during execution.
Hence it is best practice to  impose a CRUD and FLS  check in apex  before you are going to perform a DML Operations.
For more info you can check this link.
https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS  

Please Like the answer if it helps. and Mark solved if this solves your issue by selecting it a best answer.

Regards
Abhilash Mishra



 

All Answers

Abhilash Mishra 13Abhilash Mishra 13
You need to Check for Create And Update both access on Object Level As Upsert perform Both the operations.
if(!(schema.sobjectType.sobject.iscreateable() AND  Schema.sobjectType.sobject,isupdatable())){

​}

 
Ankur Saini 9Ankur Saini 9
Hi Abhilash Mishra

We have already given all the permissions to the user. Why this error occurs during code review?

Thanks 
Ankur Saini
Abhilash Mishra 13Abhilash Mishra 13
Hi Ankur, 
I understand your concern, in Apex and Visualforce. Not All the Time CRUD and FLS are Respected during execution.
Hence it is best practice to  impose a CRUD and FLS  check in apex  before you are going to perform a DML Operations.
For more info you can check this link.
https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS  

Please Like the answer if it helps. and Mark solved if this solves your issue by selecting it a best answer.

Regards
Abhilash Mishra



 
This was selected as the best answer