Guest User

Untitled

a guest
Dec 12th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public class myaccountcontroller
  2. {
  3. public String accId {get;set;}
  4.  
  5. public myaccountcontroller(ApexPages.StandardController sc)
  6. {
  7. accId = ApexPages.CurrentPage().getparameters().get('id');
  8. doCheck();
  9. }
  10.  
  11. public PageReference doCheck()
  12. {
  13. Account acc = [SELECT Id,Name FROM Account WHERE Id=:accId];
  14.  
  15. if(acc.Type =='')
  16. {
  17. PageReference mainHome= Page.Custom_Error_Page;
  18. mainHome.setRedirect(true);
  19. return mainHome;
  20. }
  21. }
  22. }
  23.  
  24. <apex:page standardcontroller="Account" extensions="myaccountcontroller">
  25. -------------------
  26. -------------------
  27. -------------------
  28. </apex:page>
Add Comment
Please, Sign In to add comment