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
Shiva VenuShiva Venu 

Accept Button on Lead in Lightening

Can we utilize standard button on Lead in Lightening to pass prevalidation and stamp some default values?

If its custom how can i build the below requirement

- Accept Button
Should be only visible to Business Rep Profile.
Button should check if the profile is Business Rep or Not once clicked.
Should check if the lead status is New, if yes set it to In progress, else in case already accepted throw and exception.
Once accepted - Business Rep Accepted button show get checked and accepted date and time should get added.

Thank you!!
ShivankurShivankur (Salesforce Developers) 
Hi Shiva,

Here is a link with similar implementation done around accept button lead object in salesforce:
https://salesforce.stackexchange.com/a/167047/96007

Similar helpful threads:
https://developer.salesforce.com/forums/?id=9060G000000MQWgQAO

Link to get help on making the custom button visible to specific profiles:
https://help.salesforce.com/articleView?id=000333302&type=1&mode=1

Hope above information helps. Please mark as Best Answer so that it can help others in future.

Thanks.
Shiva VenuShiva Venu
Hi Shivankur,

Thanks you so much for the response. 

Will the above solution suggested works both in Lightening and Classic? My understanding is not all Javasctipt button works in Ligntening.

Thanks!