Hi,
I have 2 fields: "Month No." and "Month Name". I try to make a dynamic lookup for "Month No.", so that I can use the date table to fill both fields.
This code is written in the OnLookup trigger of "Month No."
Dates.RESET;
Dates.SETRANGE("Period Start",DMY2DATE(1,1,0001),DMY2DATE(1,12,0001));
Dates.SETRANGE("Period Type",Dates."Period Type"::Month);
IF FORM.RUNMODAL(123456703,Dates) = ACTION::LookupOK THEN BEGIN
"Month No." := Dates."Period No.";
"Month Name" := Dates."Period Name";
MESSAGE(FORMAT(rec));
END;
Everything works perfect and the message shows exactly the record I want, except: I can't get to actually fill the record fields! No matter what I try, the record stays empty in the table. Even using a global variable doesn't seem to work; nav seems to forget the value after the onlookup has ended.
What could be the problem here? And: should my fields have a table relation?
Comments
Doing this doesn't solve the problem.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.