+ Start a Discussion
Lil_Ranger1111Lil_Ranger1111 

Custom Clone button

if('{!project__c.vip__c}' == 'True'){
  location.replace('{!Project__c.Id}/e?clone=1&retURL=%2F{!Project__c.Id}');
}
else{
 alert('Sorry. You cannot clone a vip project.');
}
I'm trying to create a custom clone button to allow a project to be cloned if the checkbox vip is not checked and if it's check to throw the error.  It's currently showing the error even if the check box is not checked.  I'm not sure what I'm missing.
pbattissonpbattisson
I think you want to use the value true rather than 'True' (no quotations and all lower case.
Lil_Ranger1111Lil_Ranger1111
Thanks for the replying, but it still is throwing the same error. Could it have something to do with the page being a wizard?
Lil_Ranger1111Lil_Ranger1111
I got the error to show when it's suppose to, but when it's supposed to clone it throws the URL no longer exists error.