You need to sign in to do that
Don't have an account?
@ M Coder
LWC : "Validate CRUD permission before SOQL/DML operation (rule: Security-ApexCRUDViolation)"
I am getting this warning in VS code due to my which my simple apex class is not getting called in JS when i do a import .
my apex class:
public with sharing class CarController {
@AuraEnabled(Cacheable=true)
public static List<Car__c> getCars(){
return[SELECT Id, Name, MSRP__c, Description__c,Category__c, Picture_URL__c FROM Car__c];
}
}
warning comming:
Validate CRUD permission before SOQL/DML operation (rule: Security-ApexCRUDViolation)",
My analysis: I am doing this in my own org via system admin . All the fields have FLS for the profile and class access at profile level.
if i change the soql to
return[SELECT Id, Name, MSRP__c, Description__c,Category__c, Picture_URL__c FROM Car__c with SECURITY_ENFORCED];
then also i am unable to access my class in js import statement .
can anyone please modify it what has to be done
my apex class:
public with sharing class CarController {
@AuraEnabled(Cacheable=true)
public static List<Car__c> getCars(){
return[SELECT Id, Name, MSRP__c, Description__c,Category__c, Picture_URL__c FROM Car__c];
}
}
warning comming:
Validate CRUD permission before SOQL/DML operation (rule: Security-ApexCRUDViolation)",
My analysis: I am doing this in my own org via system admin . All the fields have FLS for the profile and class access at profile level.
if i change the soql to
return[SELECT Id, Name, MSRP__c, Description__c,Category__c, Picture_URL__c FROM Car__c with SECURITY_ENFORCED];
then also i am unable to access my class in js import statement .
can anyone please modify it what has to be done
Using the below Can you confirm if you are getting the same error?
Thanks,
Thanks for quik reply
I am not getting the warning but i am unable to access my class in JS to import. if i write it manually my component fails to load with no error .