
Button or Link URL
/{!
Campaign.Id}/e?clone=1&retURL=%2F{!Campaign.Id}&00N70000002YpJC=
&00N70000002YpJH=
&00N70000002Yrjl=
&00N70000002Ylt1=
&00N70000002YpJM=
&00N70000002Yltu=
Now I have a new problem. No should be able to clone a campaign when the start date is within 10 days of the creation date, as shown in the validation rule below.
AND (StartDate <= (TODAY() +10), OR( ISblank( StartDate ), ISCHANGED(StartDate)))
Is there a way to trigger the validation rules from a custom URL button or is there a way to include the conditional statement in the URL button to prevent clones within 10 days and give a message to the user?
Finally, is there a way to create a page layout that only responds to the URL, so if someone does clone a campaign, the edit view only contains some of the fields, not all of the fields in the standard page view?
Thank you,
Rick Stevenson
2 个回答
I have some answers for you, others will hopefully provide "the rest of the story".
First, you can't fire the validation rules from a custom button, mostly because on the custom button, no object has been 'editted'. So, you'll have to put some conditional code in the javascript of the button (this is where someone who knows javascript can help!).
You can create a custom Visual Force page that contains whatever fields you want, and then have your custom button lead to that page.