Dear All,
I have created a field in a new created form with a sourcetable is from an existing table but it is a table line not header's table, I create new field last date modified like in the header and the type is date, but after I run the new form, I can't see the field last modified date is filled, although I close and open repeatedly. I also want to capture computer's system date in a new field called current date and I write in the C/AL global, but I can't also see the date filled, I am really doubt..any answers are welcome and thanks.
Rgds,
Mark
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
tks for your prompt reply. I don't know why you don't understand but nevermind I will describe as follows (but this is only example):
1. I open table production order line, I add new field called last modified date field (abbreviated : x field) with data type is date
2. create a new form using subform type from toolbox.
3. Using field menu, I look for the x field and put it into the new form, in the subform (the new form's source table is production order line that known and taken from field menu).
but when I run my new form but the last modified date is still empty, although, I close the form and then open it again., ](*,) ](*,)
any answers are welcome and tks.
Rgds,
Mark
You still do not answer Kine's question: How do you fill in date in the field.
E.g.: To update the date each time a record is modified, you have to put (something like the) following code on the tables OnModify-trigger:
"x" := WORKDATE;
Thoms Hviid Thorn
Tks for your prompt reply. Actually I want the date must same as the date in the computer/navision work date and filled in automatically, sorry for this mis answer. I don't exactly how to do this.. ](*,) :?:
Rgds,
Mark
But if you want to keep the workdate in the table, it means it will be something like "WORKDATE" when the record was inserted. Or modified etc... in this case you need to fill the date in apropriate trigger...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I might sound nosy - but checking the F1-online help for these subjects will be the easiest way for you to carry on!
Thoms Hviid Thorn
Tks again for your prompt reply, basically I don't know where to put this
"x" := WORKDATE, I've tried to put here but not work:
OnModify()
IF Status = Status::Finished THEN
ERROR(Text000,Status,TABLECAPTION);
"System Date" :=WORKDATE;
ReserveProdOrderLine.VerifyChange(Rec,xRec);
in table ID 5406.
rgds,
Mark
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
It still doesn't work because the form I created is as same as the CPOS (Change Production Order Status) form (form ID 99000914), what do you think ?
Rgds,
Mark
Something occurred to me: Are you sure you are modifying - and not renaming ?? Try and put the code on the OnRename-trigger to.
Else when I'm stucked at such a problem, I usually create very simple work sample. Here I would create a new table:
Let the "LastModified" be filled in on the tables OnModify-trigger.
- run the table,
- add a record (remember to fill-somting-in-here :-)),
- change the content in "Fill_Something_In_Here",
- leave the record (to perform an update/run the OnModify-trigger),
- and go back to it (to update the information shown).
If you can make this work, then you know how to update "LastModified", and may carry on, where you actually wants the action to happen.
Thoms Hviid Thorn