I have Custom button name as "Create reservation" where i execute javascript. Which is on "Property Object" When custom picklist field value equals to "Available" then it should redirect to another page otherwise no action perform from "Create reservation" button. How to do it? actually m newbie in salesforce. Here my OnClick JavaScript-


2 Answers 2


you can check the value in javascript. Something like

If('{!custom_picklist}' == 'Available')

try this. it will solve your problem.

  • it gives error- salesforce a problem with the onclick javascript for this button or link was encountered
    – user24524
    Sep 8, 2015 at 9:57
  • @user24524 can you share your code. Sep 8, 2015 at 10:01
  • @user24524 i am happy that it solve your problem :) Sep 8, 2015 at 10:05

It's Working-


var prop = "Available";
var propStage= '{!Property__c.Status__c}';
if (propStage!=prop)
alert("Please note - You can only create a reservation on available property.");
else {


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .