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
TEJESWARI TEJUTEJESWARI TEJU 

validate crud permission error

/**
 * @description       :
 * @author            : ChangeMeIn@UserSettingsUnder.SFDoc
 * @group             :
 * @last modified on  : 04-05-2023
 * @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
**/
public  class AccountController {
    @AuraEnabled
    public static list<Account> getAccounts(){
        //declaring list of accounts
        list<Account> lstAcc = new list<Account>();
        try {
           lstAcc = [SELECT Id, Name, Phone,Rating,Type  FROM Account];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return lstAcc;
        }
    }
SubratSubrat (Salesforce Developers) 
Hello Tejaswani ,

The Code that you have provided , it does not appear to implement any CRUD (Create, Read, Update, Delete) operations, so there shouldn't be any CRUD permission errors.

Please share the full code.

Thank you .
TEJESWARI TEJUTEJESWARI TEJU
this only iwhenever iam entering writing soql query ..the crud permission is coming
User-added image