+ Start a Discussion
Diwakar G 7Diwakar G 7 

ApexCRUDviolation Fix

Hi, 

How to fix ApexCRUDViolation for inner query. Below is the query.
proposal = [select Id, Name,(Select Id From PQConfig__Configurations__r) From Proposal__Proposal__c Where Proposal__Opportunity__c =:lead.ConvertedOpportunityId];
I tried the below one to fix the violation. Violation is fixed.
if(!Schema.sObjectType.Proposal__Proposal__c.isQueryable() && !Schema.sObjectType.PQConfig__Configurations__r.isAccessible()) {
     return null;
     }
But, PQConfig__Configurations__r is not an object. Getting error while saving class in Salesforce. Please help me to fix the violation.

Thanks and Regards,
Diwakar G

 
Diwakar G 7Diwakar G 7

Hi, 

Please help me to fix the issue.

Thanks and Regards,
Diwakar G