I want to implement change owner quick action button on opportunity page layout. without using VF page button , i want to implement this with lightning component

<apex:page standardController="Opportunity" recordSetVar="opportunities" extensions="selectedSizeWorkaround" showHeader="false" lightningStylesheets="true">

    function showToast() {
                "title": "Success!",
                "message": "{!mySelectedSize} record updated successfully.",
                "type": "success"

  <apex:form id="muform">
    <apex:pageMessage summary="Selected Collection Size: {!mySelectedSize}" severity="info" id="mupms" />
    <apex:pageBlock >
      <apex:pageBlockSection >
        <apex:inputField value="{!Opportunity.OwnerId}" />
      <apex:pageBlockTable value="{!selected}" var="opp">
        <apex:column value="{!opp.Name}"/>    
      <apex:commandButton action="{!Save}" value="Save" onclick="showToast();" />
      <apex:commandButton value="Cancel" action="{!cancel}" />

Apex Class

 public class selectedSizeWorkaround {
 ApexPages.StandardSetController setCon;

    public selectedSizeWorkaround(ApexPages.StandardSetController controller) {
        setCon = controller;

    public integer getMySelectedSize() {
                return setCon.getSelected().size();

    public integer getMyRecordsSize() {
        return setCon.getRecords().size();

I want to replce above VF page with lightning component

New contributor
Priya is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

closed as too broad by pchittum, Derek F, Reshma, battery.cord, glls Aug 12 at 14:12

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Hi @Priya. I wanted to leave a note as I've voted to close this question. Unfortunately, StackExchange isn't really intended to be a "how-to" forum. Questions are intended to be focused on a specific code or implementation problem where you've attempted a solution, and were not able to succeed or fix the problem. I would suggest looking at the LWC Recipes app as a starting point for how to solve problems with lwc: github.com/trailheadapps/lwc-recipes. For guidance on asking questions in StackExchange, please see here: salesforce.stackexchange.com/help/how-to-ask – pchittum Aug 12 at 10:45

When we create a list view button there is no option to select a lightning component, check the below snippet.

enter image description here

It can be achieved with the custom lightning component using lightning dataTable.

Not the answer you're looking for? Browse other questions tagged or ask your own question.