SETSELECTIONFILTER : ERROR MESSAGE

Hi, [:)]

It is my first post.

I have a form (FORM01) with a looto kup relation to an other form (FORM02). The goal is to make a multiple selection from the FORM02 and clic on the OK button to add thoses lines to the FORM01. Logically, I was intended to use the SETSELECTIONFILTER function.

Here is the code I put on the trigger OnLookup(VAR Text : Text[1024];)Beoolean of the FORM01**:**

CLEAR(F_JobList) ;

F_JobList.SETTABLEVIEW(Job);

F_JobList.SETRECORD(Job);

F_JobList.LOOKUPMODE(TRUE);

IF F_JobList.RUNMODAL = ACTION::LookupOK THEN BEGIN

Cpt:=0;

CurrForm.SETSELECTIONFILTER(Job);

IF Job.FINDSET THEN //S

REPEAT

Cpt:=Cpt+1;

MESSAGE(’%1’,Cpt);

T_Eligible56204.INIT; // initialise the record (does not initialise primary key)

T_Eligible56204.“Qualification Code” :=Rec.Code;

T_Eligible56204.Type := T_Eligible56204.Type::Job;

T_Eligible56204.Code := Job.“No.”;

T_Eligible56204.Name := Job.Description;

T_Eligible56204.INSERT;

UNTIL Job.NEXT = 0;

END;

THE PROBLEM is that I recieve an error message when I clic on the OK button :

Copying all filters at once can only be done between records beloinging to the same table.

An idea ? [:)]

Thanks

Does the form you are running the code from have the Job table as its Source Table? I think you may have meant to do F_JobList.SETSELECTIONFILTER

Hi, [:)]

Thank you for your answer but no, the FORM01 is based on two other tables.

The function SETSELECTIONFILTER is working only from the current form, doesn’t it ?

Take a look at the Item List form. There should be a function called GetSelectionFilter that you can model your solution after. You could place it in your JobList form and use it.