Creating date regarding to computer's system date

mark_christs
Member Posts: 156
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
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
-
Ok, you created some field and added this field to the form. But, how you are filling this field? I do not understand what you did and what you want to do...0
-
Dear Kine,
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,
Mark0 -
Hej Mark_Christ
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;With Kind Regards
Thoms Hviid Thorn0 -
Dear All, Thomas,
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,
Mark0 -
In this case, if you want to see just computer date, you do not need any new field in your table. You just need to add new edit box into your form and set source to TODAY or CURRENTDATETIME or TIME (depend on what you want, date, date and time or just time). Or if you want workdate then source will be WORKDATE.
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...0 -
Hej Mark,
I might sound nosy - but checking the F1-online help for these subjects will be the easiest way for you to carry on!With Kind Regards
Thoms Hviid Thorn0 -
Dear All,
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,
Mark0 -
Yes, this will update the field if someone change the record. You need to "touch" the record to have the field filled...0
-
Dear Kine, All,
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,
Mark0 -
Hi 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:OBJECT Table 50505 Thomas_Testing { OBJECT-PROPERTIES { Date=26-04-06; Time=11:56:16; Modified=Yes; Version List=; } PROPERTIES { OnModify=BEGIN LastModified := WORKDATE; END; } FIELDS { { 1 ; ;Key Field ;Code10 } { 2 ; ;Fill_Something_In_Here;Text30 } { 3 ; ;LastModified ;Date } } KEYS { { ;Key Field } } CODE { BEGIN END. } }
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.With Kind Regards
Thoms Hviid Thorn0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions