Hi Nav masters,
I have a problems. I fill my Lookup form using records that i get with Mark.
But when the form shows, it have a Mark sign on the left side. How can i remove those Mark sign, and Put my cursor to the 1st record?
This is the example of my code:
Rec_Employee.MARKEDONLY(TRUE);
Frm_Employee.LOOKUPMODE := TRUE;
Frm_Employee.SETTABLEVIEW(Rec_Employee);
Frm_Employee.SETRECORD(Rec_Employee);
IF Frm_Employee.RUNMODAL = ACTION::LookupOK THEN BEGIN
Frm_Employee.GETRECORD(Rec_Employee);
VALIDATE("Requested By", Rec_Employee."No.");
END;
Thanks in advance
______________
Regards,
Steven
0
Answers
2) If you do not see the marks, you will need to use temporary table, into which you insert the marked records and you will pass this temporary record to the form.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I already try using temporary table but still cannot.
My code is like this: <Rec_Employee1 is temporary>
Rec_Employee.MARKEDONLY(TRUE);
Rec_Employee1.DELETEALL;
Rec_Employee1.COPY(Rec_Employee); // i try Transferfields also cannot
Rec_Employee1.CLEARMARKS;
Frm_Employee.LOOKUPMODE := TRUE;
Frm_Employee.SETTABLEVIEW(Rec_Employee1);
Frm_Employee.SETRECORD(Rec_Employee1);
IF Frm_Employee.RUNMODAL = ACTION::LookupOK THEN BEGIN
Frm_Employee.GETRECORD(Rec_Employee1);
VALIDATE("Requested By", Rec_Employee1."No.");
END;
How to do it?
Thanks in advance
Regards,
Steven
COPY function doesn't copy records! It just copy filters and sorting, but not records. You need to go through all the records in a loop and insert them into the temporary.
(And I recommand to use name like TempRec_Employee or something like that with the Temp or Buffer in the name to clearly state, that the record is Temporary table).
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I already follow your instruction.
But now i have all records instead of the records that only i mark.
Weird...
I put my code in table (on lookup) and not in form, is it correct?
Thanks in advance
Regards,
Steven
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
This all my code: <Rec_TempEmployee is the temporary table>
Rec_TempEmployee.DELETEALL;
Rec_Employee.MARKEDONLY(TRUE); //i found 3 records
IF Rec_Employee.FINDSET THEN //i also try Find('-'), cannot too
REPEAT
Rec_TempEmployee := Rec_Employee;
Rec_TempEmployee.INSERT;
UNTIL Rec_Employee.NEXT = 0;
Frm_Employee.LOOKUPMODE := TRUE;
Frm_Employee.SETTABLEVIEW(Rec_TempEmployee);
Frm_Employee.SETRECORD(Rec_TempEmployee);
IF Frm_Employee.RUNMODAL = ACTION::LookupOK THEN BEGIN
Frm_Employee.GETRECORD(Rec_TempEmployee);
VALIDATE("Requested By", Rec_TempEmployee."No.");
END;
Is there anything i miss?
Thanks in advance
Regards,
Steven
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Regards,
Steven