Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:page controller="myclass" action={!clean}>
- </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;
- }
- }
- <apex:page controller="MyClass">
- Processing...
- <!-- Submit the page via action function on onload event to avoid XSRF issues -->
- <apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"/>
- <apex:form >
- <apex:actionFunction name="clean" action="{!clean}"/>
- <script>
- j$ = jQuery.noConflict();
- j$().ready(function() {
- clean();
- });
- </script>
- </apex:form>
- </apex:page>
Add Comment
Please, Sign In to add comment