You need to sign in to do that
Don't have an account?
Brian Ferrari
Custom Button Using OnClick Java Script
I created a custom clone button. I want to only permit clone if certain fields are empty. In the script below I am just checking one field until I get this to work. I have never used the OnClick option in a custom button and I am not familiar with Java Script. The following script runs but always produces the error. I can't get the cloned case to appear. Any ideas? I may be approaching this totally wrong.
Development_PM__c is a custom lookup field. If it is blank I want to proceed cloning. If populated, throw the alert.
if('{!Case.Development_PM }' == ' ' || {!Case.Developer__c} <> ' '){
location.replace('{!Case.Id}/e?clone=1&retURL=%2F{!Case.Id}');
}
else{
alert('Sorry!. Can't clone a case that has PM and/or development fields populated.');
}
Development_PM__c is a custom lookup field. If it is blank I want to proceed cloning. If populated, throw the alert.
if('{!Case.Development_PM }' == ' ' || {!Case.Developer__c} <> ' '){
location.replace('{!Case.Id}/e?clone=1&retURL=%2F{!Case.Id}');
}
else{
alert('Sorry!. Can't clone a case that has PM and/or development fields populated.');
}
if('{!Case.Development_PM }' == ' ' ){
location.replace('{!Case.Id}/e?clone=1&retURL=%2F{!Case.Id}');
}
else{
alert('Sorry!. Can't clone a case that has PM and/or development fields populated.');
}