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
Melissa TomaskoMelissa Tomasko 

I am trying to create a workflow that will trigger when a custom button is clicked

I am new to creating custom buttons and I am wondering how I might be able to trigger a workflow when a custom button is clicked.

My end goal is to have a button in the account object that reads "Request Account", when clicked I would like the button to trigger a workflow that will will fill in three fields:
1. A check box that reads "Requested Account"
2. A text field that will automatically fill in with the name of the user that has clicked the "Request Account" custom button
3. A auto fill in date field that fills in with the date the button was clicked.

At the same time I would also like the buttons clicks to trigger an email automation that will send directly to my email when the button is clicked.

How would I set up this entire process including the auto fill in fields.
kirubakaran viswanathankirubakaran viswanathan
Hi Melissa,

Try the code in the custom button to update the fields in the account. 
Once the fields are updated, write a workflow rule/ Process builder to send email alert to user.

https://developer.salesforce.com/forums/?id=906F0000000AnS4IAK
Hope this will work.

Thanks,
Kiruba