• Brian Ferrari
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
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.');
}
I created a case clone using visual flow and a custom buttom.  How do I get the cloned case to display.  Obviously I need to get the clone case ID in the retURL=/{!Case.Id}.  I am not sure how I capture that in the Flow.
Hello

My users often use the clone case button.  Unfortunately, the cloned cases have fields populated that should not be when a case is first created.

Currently, I clear some of the fields using the URL on a custom button but I would prefer to create a VF page that mimics my case page layout. What is the easiest way to basically duplicate my Standard case page layout in VF for my new Clone case button?

Thank you in advance for your time.

B
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.');
}
I created a case clone using visual flow and a custom buttom.  How do I get the cloned case to display.  Obviously I need to get the clone case ID in the retURL=/{!Case.Id}.  I am not sure how I capture that in the Flow.