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
TapasviniTapasvini 

CSRF-error

Hi,

I have Following page:

<apex:page controller="myclass" showHeader="true" sidebar="true" action={!clean} tabStyle="heatmap__tab" ></apex:page>

and controller class as:

public with sharing class myclass

{

public void clean()

{

List<auditcount__c> existing = [SELECT Id From auditcount__c LIMIT 10];
delete existing;

}

}

 When I try scanning my code for the security review, I get Cross Site Reference Forgery error for the above page.

Can anyone please help on how should I enforce Cross Site Reference Forgery in the above VF page? I saw the examples salesforce gave but i couldn't apply it to my case as I need to delete all record from object.