Hi
Thanks for responding!
Below is my code snippet of the lookup field:
(Employment Code is the lookup field,
EmploymentDetailsTable is the table name from where the lookup points.)
field("Employment Code"; "Employment Code")
{
ApplicationArea = All;
Enabled = ValidRecord;
trigger OnLookup(var Text: Text): Boolean
var
EmploymentDetailsTable: Record EmploymentDetailsHeader;
EmploymentDetailsListPage: Page EmploymentDetailsList;
Begin
EmploymentDetailsTable.RESET;
EmploymentDetailsTable.SETFILTER(EmployeeNo, "No.");
CLEAR(EmploymentDetailsListPage);
EmploymentDetailsListPage.SETRECORD(EmploymentDetailsTable);
EmploymentDetailsListPage.SETTABLEVIEW(EmploymentDetailsTable);
EmploymentDetailsListPage.LOOKUPMODE(TRUE);
IF EmploymentDetailsListPage.RUNMODAL = ACTION::LookupOK THEN BEGIN
EmploymentDetailsListPage.GETRECORD(EmploymentDetailsTable);
"Employment Code" := EmploymentDetailsTable.No;
END
END;
}
Please let me know if you need more information for inspecting.
Regards
Khudeja