I'm facing an issue in redirecting to a VisualForce page using a custom button in which the button content source need to be an URL which need to validate a particular filed is null or not. If yes,it should redirect to a VF page else it should redirect to a different page.

Formula: {!IF( ISBLANK( Lead.Company ) , "/apex/page1", "/apex/page2")}

I tried using different scenarios but facing this error:


Please help me finding a way to solve this.

Thanks in advance...!!!

  • Have you tried with a full URL? – Sebastian Kessel Jul 19 '16 at 16:38
  • Yes, I did but it's redirecting to this link ** URL:na30.salesforce.com/servlet/… ** – Sammy Jul 19 '16 at 20:47
  • Which object did you create the button? – Rao Jul 19 '16 at 21:04
  • I need to create a custom button on lead object. When ever the user hits the button it should rout to VF pages(Page1,Page2) with some validation on a filed were to redirect the page. – Sammy Jul 20 '16 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.