Multiply selected rows from the list page in rtc.

Hi All, Recently I got a requirement for muliply selecting rows then do something logic based on what I selected.

I got this function SETSELECTIONFILTER, But I see from the document “Notes the records that the user has selected on the form, marks those records in the table specified, and sets the filter to “marked only”.”, If this function is supported in rtc?

If I don’t use that function, How do I mark the records in the rtc? I didn’t find any operation like the classic.

Any suggestion will be warmly appreciate.

Thanks in advance.

You can use a temp table. Which is probably more efficient than a MARK.

Munib Thanks for your reply.

But How do I transfer what I selected rows to the temp table?.

Because I need copy some fields from what I selected to the other table. I just tried such code,But it seems doesn’t work.

//Remark: TestPage is a record refer to Item table.

// CurrPage.SETSELECTIONFILTER(TestPage); Put it on here or below are both not work , I got such error : The table IDS do not match.
IF (PAGE.RUNMODAL(PAGE::“Item List”,TestPage) = ACTION::LookupOK) THEN
BEGIN
// CurrPage.SETSELECTIONFILTER(TestPage);
TestPage.FIND(’-’);
REPEAT
IF TestPage.MARK THEN
BEGIN
// MESSAGE(‘You have chosen’ + TestPage.“No.”);
MESSAGE(‘aaa’);
END;
UNTIL TestPage.NEXT =0 ;
END ;

Any suggestion will be warmly appreciate.

Thanks in advance.

I created a simple Button and under it I put this code.


TempItem.DELETEALL;

CurrPage.SETSELECTIONFILTER(Item);
IF Item.FINDSET THEN
  REPEAT
    TempItem := Item;
    TempItem.INSERT;
  UNTIL Item.NEXT = 0;

//Test our selection worked
TempItem.RESET;
IF TempItem.FINDSET THEN
  REPEAT
    MESSAGE(TempItem."No.");
  UNTIL TempItem.NEXT = 0;

It just loops through and gets the selection. Inserts it into a temp table. Then displays the message box for each.

Now if you want to get the selection from another form/page. You can try this.

On your lookup form you will need to write a function that retrieves your temp table. Similar to the function that is on the Item List GetSelectionFilter(). Instead of returning a Code80. Make it so that it returns your TempItem. (use the code above to insert it into the temp table)

IF ItemList.RUNMODAL= ACTION::LookupOK THEN
  ItemList.GetSelectedItems(TempItem);

Hope this helps