1

I would like to Clone an Opportunity with required fields (enforced by validation rules) which have not yet been populated. It is therefore giving the users an error when they attempt to Clone on that record.

I believe this is the correct behavior for Salesforce. If so, is there a way around this to allow users to Clone With Details on the Opp without removing the Validation Rule ?

Thank you very much for the help.

  • 2
    Can you build a "bypass" into the validation rules? Something like NOT(ISNEW()) && (original logic here). It won't differentiate between creation of fresh Opportunity & making of a clone though. – eyescream Apr 18 '13 at 13:52
  • Agree with @eyescream, the other alternative might be a before trigger, which runs before the validation rules. – techtrekker Apr 18 '13 at 14:00
  • @techtrekker. Unless the additional required fields are added, aren't the validation rules going to cause the same problems when the incomplete record is saved, causing it to fail when saved by the user? Zoom_v, do you need to save the record at the time it's cloned? If not, and you're just populating the fields in the VF page so the user can add the required info to allow them to later save as new, am not certain what the issue is. Are you "cloning" or "deep cloning"? – crmprogdev Apr 18 '13 at 14:28
  • techtrekker : the validation rule in question is new. So the problem is only happening when users go into an already made Opp and attempt to do a Clone. So really, the suggestion from @eyescream is probably the solution. However... As it turns out, a custom button was being used here (based on a s-Control) not a standard Clone. I was told otherwise before. So technically it's not cloning, but creating new Opps and mapping the fields from the current one. The required fields in question were not included in the mapping so the error was happening there. Thanks for the input you two. – Zoom_v Apr 18 '13 at 16:58
  • You're welcome! It's still a valid answer that might catch somebody else off guard (S-Controls, yuck). Would you consider answering your own question & accepting so it goes "off the radar"? – eyescream Apr 18 '13 at 17:16
2

As it turns out this was based upon a custom button which was technically not "cloning" but creating new records in the back-end. The newly required fields were not included in the mapping in the button so that was producing an error in the creation.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.