Guest User

Untitled

a guest
Jan 23rd, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <apex:page controller="myclass" action={!clean}>
  2. </apex:page>
  3.  
  4. and controller class as:
  5. public with sharing class myclass
  6. {
  7. public void clean()
  8. {
  9. List<auditcount__c> existing = [SELECT Id From auditcount__c LIMIT 10];
  10. delete existing;
  11. }
  12. }
  13.  
  14. <apex:page controller="MyClass">
  15. Processing...
  16.  
  17. <!-- Submit the page via action function on onload event to avoid XSRF issues -->
  18. <apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"/>
  19. <apex:form >
  20. <apex:actionFunction name="clean" action="{!clean}"/>
  21. <script>
  22. j$ = jQuery.noConflict();
  23. j$().ready(function() {
  24. clean();
  25. });
  26. </script>
  27. </apex:form>
  28.  
  29. </apex:page>
Add Comment
Please, Sign In to add comment