+ Start a Discussion
ArunaAruna 

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 .

gautam_singhgautam_singh
Hi, 



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 (https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_a_h.htm&language=en_US#GETRECORDIDS" 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: http://www.infallibletechie.com/2014/03/how-to-get-selected-records-from-list.html

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

I would like to open vf page in sepearte window .
 so on java script button window.open('/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>
    </apex:pageBlock>
</apex:page>

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