function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shree KShree K 

How to bypass the validation rule for a custom clone button?

I have a VR that makes a field required , I would like to have this to be excluded while cloning(custom button), Please let me know if this possible through configuration, currently cloning process is handling by an Apex class in my Org,if apex is the way to resolve this issue, sample piece of code would be much appreciated.
Either bypassing the VR or making the Product__c field empty upon cloning works for me.
VR as follows:
AND(RecordType.Name = 'Global', 
ISBLANK(Product__c), 
OR(IsPickVal(Confirmed__c,"Yes")))

Thanks
CK
ajay rawat 14ajay rawat 14
Hi,
You can create a flag set it when you want to skip VR and then revert it back using workflow. In this case you have to use AND condtion in formula field including your condition.

Hope this will work for you.

Thanks
Ajay Rawat
Anil JAdhav 14Anil JAdhav 14
Hi,
Another way is -
You can use URL hacking to achieve this.
1. Create one of the custom text field for the flag.
2. Override the clone button, and populate the custom field by some value let say 'Skip'
3. Now make changes in VR by using skip condition.
 User-added image