Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class myaccountcontroller
- {
- public String accId {get;set;}
- public myaccountcontroller(ApexPages.StandardController sc)
- {
- accId = ApexPages.CurrentPage().getparameters().get('id');
- doCheck();
- }
- public PageReference doCheck()
- {
- Account acc = [SELECT Id,Name FROM Account WHERE Id=:accId];
- if(acc.Type =='')
- {
- PageReference mainHome= Page.Custom_Error_Page;
- mainHome.setRedirect(true);
- return mainHome;
- }
- }
- }
- <apex:page standardcontroller="Account" extensions="myaccountcontroller">
- -------------------
- -------------------
- -------------------
- </apex:page>
Add Comment
Please, Sign In to add comment