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
Sahil Bansal 7Sahil Bansal 7 

Security Review CRUD Issue

Hi Folks,

I ran checkmarx security scanner on managed package and came up with following CRUD issues : Query: CRUD Delete
database.delete(vPlays);



As per the salesforce documentation I have already applied the isAccessible() and isDeletable() checks as follows:
 
List<vPlayBookRules__c> vPlays = new List<vPlayBookRules__c>();  
				 Id RuleId = editvPlayBook.Id; 
                if(Schema.sObjectType.vPlayBookRules__c.isAccessible()){
                    vPlays = [Select Id from vPlayBookRules__c where ID =: RuleId LIMIT 1];                
                }
                if(vPlays.size() > 0){
					if (Schema.sObjectType.vPlayBookRules__c.isAccessible() && Schema.sObjectType.vPlayBookRules__c.isDeletable()) { 
					   database.delete(vPlays);                     
					}
				}

Any help will be highly appreciated

Thanks!
NagendraNagendra (Salesforce Developers) 
Hi Sahil,

Please check with below link from stack exchange community with similar issue which might help you to accelerate with above requirement. Please mark this as solved if it's resolved.

Regards,
Nagendra