+ Start a Discussion
vamshi kothakapu 9vamshi kothakapu 9 

Security review for soql subquery

User-added imageNeed to know how to get rid of the PMD report listing of the soql with subquery 
            Approval.ProcessWorkitemRequest[] prWkItems = New Approval.ProcessWorkItemRequest[]{};
            if(!Schema.sObjectType.ProcessInstance.isAccessible()  && !Schema.sObjectType.ProcessInstanceWorkItem.isAccessible() && !Schema.sObjectType.ProcessInstanceStep.isAccessible()){ 
           /* if(!Schema.sObjectType.ProcessInstanceWorkItem.isAccessible()){
                pageMessage('Steps');  //  isQueryable() 
                ProcessInstance[] pi = [Select ID, Status, TargetObject.Name,     
                                        (SELECT Id, ActorId, ProcessInstanceId FROM Workitems),(SELECT Id, StepStatus, Comments FROM Steps) 
                                       From ProcessInstance 
                                        Where TargetObjectID=:PerAppID AND  Status = 'Pending' WITH SECURITY_ENFORCED];
vamshi kothakapu 9vamshi kothakapu 9
Soql querycomes under 205 line issue on PMD report