Get marked records

hi :slight_smile: I’m having this problem. Please help me!!!

I have a form and a subform. I need to get all the record marked in the subform.

I’ve created a function in my subform called MyFuncion:

MyFunction()
MyRec.COPY(Rec);
CurrForm.SETSELECTIONFILTER(MyRec);

In the main form i have a button that OnPush() call MyFunction: “CurrForm.abc.FORM.MyFunction()”;

I can’t get my marked records in the main form.

Thank u all

Best is to create a parameter in the function that is a temptable. In the function, you fill up the temptable with the marked records. In the mainform, you can then read the temptable.

Thank you.

But how can i read the temp table in my main form?

Sorry, i’m just geting started with c/al.

Main form:

-define a global record “tmpTempTable” with property Temptable=Yes

CurrForm.abc.FORM.MyFunction(tmpTempTable);

tmpTempTable.RESET;

IF tmpTempTable.FINDSET THEN

REPEAT

MESSAGE(‘Some Field:%1’,tmpTempTable.“Some Field”);

UNTIL tmpTempTable.NEXT = 0;

-in the subform:

MyFunction(VAR PtmpTempTable as record [with property TempTable=Yes])

PtmpTempTable.RESET;

PtmpTempTable.DELETEALL(FALSE);

MyRec.COPY(Rec);
CurrForm.SETSELECTIONFILTER(MyRec);

IF MyRec.FINDSET THEN

REPEAT

PtmpTempTable := MyRec;

PtmpTempTable.INSERT(FALSE);

UNTIL MyRec.NEXT = 0;

I think it’s almost done… :slight_smile:

The program gives me the selected ones instead of the marked…

Is it possible to get the Marked Records?

SETSELECTIONFILTER is used to get the selected records. To get the marked one, use MARKEDONLY.

Thank you all. My problem is solved.