get selected sets on subform

Hi, I have a subform in a form. The subform has a specific TableView selected in the SOURCETABLEVIEW-Property (SORTING … WHERE …). Now I select some sets in the subform (may be 3 from 6) without the mark-function (STRG-F1) - just with mouse-click. Is there any possibility to get these selected sets in a record-variable? My first intention was to create a variable of subform, write a function on subform and call it from mainform in this way: myrec := CurrForm.mysubform.FORM.myFunctiontogetSets But the main problem is how to get just the selected sets on subform, if they only selected but not marked? Has there anyone a solution? thanx martin

From the C/AL manual:

quote:


CurrForm.SETSELECTIONFILTER(Record) Use this function to have the system note the records the user has selected on the form, mark those records in the table specified, and set the filter to “marked only”.


This should do the trick [;)]

You can use CurrForm.SETSELECTIONFILTER(ToRecord) function. ToRecord variable will contain only records you have selected in form.

You have to the mark functionality. It’s the only (good) way! In your “MyFunctiontogetSets” you will need to call the “CurrForm.SETSELECTIONFILTER” statement / function. Use VAR Parameters to pass your selection (record plus filters) back to your mainform. So your function would be “CurrForm.mysubform.FORM.myFunctiontogetSets(VAR RecVar)”. SETSELECTIONFILTER Use this function to have the system note the records the user has selected on the form, mark those records in the table specified, and set the filter to “marked only”.

… thanks a lot! The SETSELECTIONFILTER - Function in connection with the mark functionality is the solution! [:D]