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
Matthew AllenMatthew Allen 

validation rule URL hack button

Hi All,

We are still on Classic (Lightning coming soon ish...) and have a URL hack button. I need to try and add some validation to it so that users can only press the button if a certain field is true?

Below is my basic URL hack, I just need it to only be clickable if Opportunity stage = New.

Can anyone help? My understanding is it needs to be a Java Script button but I am struggling.
 
/a2e/e?


CF00N1l000001WseX={! Opportunity.Name }&
CF00N1l000001WseX_lkid={! Opportunity.Id }&


retURL={!Opportunity.Id}

 
AbhishekAbhishek (Salesforce Developers) 
Have a look at this web page that may help you or give you some information regarding your concern.

Although Salesforce does not officially support URL hacks, many of us use them to address a number of use cases.
With the introduction of Lightning Experience, this option is restricted because:

If you use URL custom buttons to pass parameters to standard pages in Salesforce Classic—such as pre-populating fields when creating a record—this behavior doesn’t work in Salesforce1 or Lightning Experience.
Original Post (https://www.linkedin.com/pulse/salesforce-lightning-url-hacking-alternatives-keith-mcrae)

For further reference, you can check this blog too (https://www.mstsolutions.com/technical/url-hack-button-lightning-experience/).

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
Matthew AllenMatthew Allen
No, sorry, that doesn't help. I understand the pitfalls of URL hacking (and currently developing Lightning including the new process) but this needs to be in classic today.

Thanks for your input.
Malika Pathak 9Malika Pathak 9
Hi Diana Contreras,

 I think you should try a formula variable and then 
insert This formula there
'SR<'+{$Account.Name}+'>- 001'

Please mark it as the best answer if it helps you to fix the issue.

Thank you