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

How to know which opportunity is selected when I select a check box on standard list view page Action check box ?

Hi there,

I have a task need to select a opportunities using standatd list  view page under "Action " check box.
when i check a check box select those opportunities and do some business logic and diaply message.
my question how can i know what are the opportunities are selected using Action check box  is it possible ? since that is standard page opportunity list view page .


You can use the {!GETRECORDIDS( $ObjectType.Opportunity)};  to get the Id of the selected Opportunity. The Formula GETRECORDISS returns an array of strings in the form of record IDs for the selected records in a list, such as a list view or related list..

You can read more about it here (" target="_blank)and an example for it is demostrated here.

Important :

If this is what you where looking for then please mark it as a solution for others benefits.

Thank You

Shabbir ShaikShabbir Shaik
Hi Arun,

Try like this,

create Listbutton on opportunity layout and get records Extension controller do your business logic there.

Here is example:

If this helps for you, mark this as a best answer.
Hi Shabbir,

I would like to open vf page in sepearte window .
 so on java script button'/apex/MarkAsLostOpportunityPage',"_blank","width=200", "height=50" );

<apex:page standardController="Opportunity" extensions="MarkAsLostOpportunityController" recordSetVar="Opportunityrecord">
    <apex:pageBlock >
       <script> alert("I am working="+{!OpportunityList.size}); </script>

I am getting zero records selected. but if i put  content is visulaforce page it is worrks.
I want  on button OnClickJava script. can help me out