• ErikEitel
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Administrator
  • Millennium Systems International


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
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!
 
<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>

 
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!
 
<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>