You need to sign in to do that
Don't have an account?
ErikEitel
Override New Case Button with Visualforce Page
Hi All-
I am trying to override the New Case button on accounts when account Billing Status = Cancelled. This is what I have so far, but I'd love some input. When I click the New Case button, instead of generating my VF error page, it asks me to select a record type, and when I do, it just goes back to the record type selection page. In theory I shouldn't even be getting to the record type selection when the criteria is met, but should just be sent to the VF error page I created. I have to use the Case standardController to override the New Case button, but I wonder if that's my issue since I'm trying to prevent an action from happening when there's no case to reference. Thanks!
I am trying to override the New Case button on accounts when account Billing Status = Cancelled. This is what I have so far, but I'd love some input. When I click the New Case button, instead of generating my VF error page, it asks me to select a record type, and when I do, it just goes back to the record type selection page. In theory I shouldn't even be getting to the record type selection when the criteria is met, but should just be sent to the VF error page I created. I have to use the Case standardController to override the New Case button, but I wonder if that's my issue since I'm trying to prevent an action from happening when there's no case to reference. Thanks!
<apex:page standardController="Case" action=" {! IF(case.Account.Billing_Status__c == 'Cancelled', URLFOR($Page.CasePageMessenger, case.id,[id=case.id],FALSE), URLFOR($Action.Case.NewCase, case.id,[retURL="/001"], TRUE) ) }"> <apex:pageMessage severity="ERROR" strength="3" title="Case Create" summary="This Account is cancelled and can not receive support."> </apex:pageMessage> </apex:page>
kevin lam
Did you check the "Skip Record Type Selection Page" option when overriding the New button?
ErikEitel
I did. I've isolated the issue to the case.Account.Billing_Status__c field. When I switch the == to <> it will trigger the $Page.CasePageMessenger url even if case.Account.Billing_Status__c == 'Cancelled' indicates it should go to the 2nd URL in the IF statement.