cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture indexes of multiple rows selected in Advance list

Former Member
0 Kudos

Hi,

- I have a prefilled advance list with multiselection enabled.

- There is a button, associated with an action,which is bind to a eventHandler,that event Handler has script operation which conains the ruby scrpt code.

- Now when i select multiple rows of that advance list and click on the action,I want to capture the indexes of all the selected rows.

I tried using following ruby code:

      • lead=$data.datalist.LeadSelectedIndex

But it returns index of only first row selected out of various rows selected.

So please anyone help me on that.

Regards ,

Saurabh Sharma.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member

Hi Saurabh,

For executing multiselecton on an advanced list pane, there is no need for fetching the "lead values" of each row selected.

Do the following:

1. In the adv list pane properties , select multiselection.

2. The eventhandler in which you was to execute the action, make that BO action 'istance bining' at the datalist's level , instead of root.

3. Add this eventhandler to the onclick event of a button.

Result : When many rows of the datalist are selected at a time and you click on the button, then , the BO action will be executed for every row selected automatically .

Hence multiselection will work.

NiteshPai
Product and Topic Expert
Product and Topic Expert
0 Kudos

In FP2.6 there is no chance from SDK to have a mass enabled Action and bind to a mulli selection list as a BO Action in the UI Designer, as multiplicity will always be single and only lead selection would be selected.

this feature comes only in FP3.0.

So i am not sure what excatly Saurabh wants to do : maybe do some calculations based on multi seletions then i would do the following as also what Christian mentioned

multiSelect = ($data.DataList.GetSelectedRowsCount() > 1);

NoOfRowsSelected = $data.DataList.GetSelectedRowsCount();

SummationField = 0;

if ( multiSelect )

LeadSelection = $data.DataList.LeadSelectedIndex;

RequiredDataField = $data.DataList.Get(LeadSelection).AnydataField;

for i in 0..(NoOfRowsSelected - 1)

currentRow = LeadSelection + i;

RequiredDataField = $data.DataList.Get(currentRow).AnydataField;

// imagine this is just add values of the RequiredDataField

SummationField = SummationField + RequiredDataField

end

end

So i have not tried this directly - but i hope i make the idea clear.

Regards,

Nitesh Pai

SAPjedi
Contributor
0 Kudos

Milin,

I know we're at 1405 Studio... so perhaps things have improved.


I have an OWL for my custom BO, and the OWL is studio generated.  I did turn on Multi-select in the Properties..

By multi-select, i assume we are using Microsoft standards of using Ctrl-Click to select individual rows, and Shift-Click to select a range of rows.

It does not seem to do multi-select.  Do you know why ?

Thanks,

Tim.

Former Member
0 Kudos

Thanx Andreas for that important information

But we dont need to go in complexities here, All I need is to have a Ruby script code or function that is used to capture the indexes of selected rows in multiselection enabled advance list.

Regards,

Saurabh

former_member47640
Active Contributor
0 Kudos

I checked the documentation for the Ruby code snippets.

LeadSelectedRow of course only gives you one value back, the one of the lead row. In your case that's the first row.

The only related thing in the documentation for multiSelect-rows is this example for getting the number of selected rows back. But maybe this helps to explore other possibilities:

multiSelect = ($data.DataList.GetSelectedRowsCount() > 1)

if (multiSelect)

...

Former Member
0 Kudos

Hi,

I think you can`t do this at this time cause partners don`t have the possibility to define "multiple actions" in BODL.

You can take a look in marketing/target group definition, there SAP uses a multiple select advanced list pane...

path: /SAP_BYD_APPLICATION_UI/crm/mark/targetgrpgaf -> Step 2 -> Add button in first advanced list pane

event handler in controller is: BOAct_AccountsAndContactsAddSelected

SAP uses an action with type "multiple". I can`t give you more information cause the action is in an ECO and I can`t see ECOs...PSM scwitch is on

Question to SAP...When partners may define multiple actions? When we get the possibility to sometimes take a look behind the PSM? Switch for partners?

Regards,

Andreas