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
K RoyK Roy 

How to automate a button click in a lightning page? I have a requirement where, based on a checkbox field value, a button will be click automatically. The button is present in a lightning page. Please help

I have a requirment where, i need to call a button automatically based on a field value in the opportunity object. The button is present in a lightning page.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Roy,

We cannot automate clicking of the button based on some field change. We can achieve something as based on the field change we can automate the process involved in button click.

Suppose a button click is sending an email you can add logic such that when a field is updated then we can build logic such that it sends email automatically  without button onclick.

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

K RoyK Roy
Hi Sai,
We have a button, which opens a lightning page. That page has got 2 buttons. One is "Save & Close" and another is "Save & Email". I need to replicate the action that is happening behind the button click on "Save & Email".

how can that be done?

K RoyK Roy
Also, behind the "Save & Email" button, not only email, button a series of changes like, new case creation, various field updates & email is being sent