How do I set default date or time in Navision table( date/ t

manuv
Member Posts: 5
How do I set default date or time in Navision table( date/ time type field)
0
Comments
-
Could you explain a liitle bit more what you want to do?
DateField := 31121977D; //or workdate or today <- both are system constantsDo you make it right, it works too!0 -
what do you mean by default date & time - you mean like an start date I would put code OnInsert or the table.
example//
OnInsert()
"Start Date" := TODAY;
OnModify()
"Date Modified" := TODAY;
in this example "start date" & "date modified" are the fields you want to have updated when an action occurs.0 -
Tools>Workdate.David Singleton0
-
thats set not the default date in Navision table. Per defaul the initvalue is 0D and this is (on SQL the 1753-01-01 00:00:00.000)
That set the default date for, for example, document dates on order. but not for all date fields.
The question is: what will manuv do :?: (Maybe the workdate is all what he need?)
PS: With "T" in a datefield you get the Systemdate (T-> Today) and with a "W" you get the workdate (how to set the workdate has David described)
RegardsDo you make it right, it works too!0 -
garak wrote:PS: With "T" in a datefield you get the Systemdate (T-> Today) and with a "W" you get the workdate
Not on Tuesdays and Wednesdays you don't :shock:David Singleton0 -
;-) in my local Database (german) i have not these probs.
H -> Heute (Today)
A- > Arbeitsdatum (Workdate)
And there is no weekday that begins with an H or A :-)
But: when i change the language to English and i press "W", it use the changed workdate, if i press T it use the systemdate.
So, is it really so in your database that the T and the W is not the default for Today / Workdate. In my it is the default.
"Tu" or "Th" are for Tuesday / thursday and We for Wednesday.
regardsDo you make it right, it works too!0 -
garak wrote:;-) in my local Database (german) i have not these probs.
H -> Heute (Today)
A- > Arbeitsdatum (Workdate)
And there is no weekday that begins with an H or A :-)
But: when i change the language to English and i press "W", it use the changed workdate, if i press T it use the systemdate.
So, is it really so in your database that the T and the W is not the default for Today / Workdate. In my it is the default.
"Tu" or "Th" are for Tuesday / thursday and We for Wednesday.
regards
Only sometimesDavid Singleton0 -
Try this in a US version of Navision.
Open a report or form any where you can enter a date filter:
enter : ..t <t ..w <w
then try tomorrow and again next tuesday. I really can't remember the combinations and results, but I know they will be wrong.David Singleton0 -
Thank you for all the immediate responses.
All the above answers partially or completely agreeing my experiments.
This is my situation. I already resolved the issue, but I like to share my experiments, thanks.
One of my Navision 2009 table (Sql server 2005) partially updated by Navision program and partially by an external application (VB 2008 and SQL connection)
So what I understood from all my testing are, Navision table column settings (Object designer Table Design select the column Properties) (Eg: InitValue, Blank Number etc ) has no effect on actual SQL table init settings (in SQL SERVER) . For example, Navision does not allow NULL values, so to replace the null value update from an external application you have 2 options
1 option is programmatically check Navision compatible test before update
2 option is preset the default property of the table columns with Navision type column initialization values (varchar ‘’, DateTime ‘1753-01-01 00:00:00.000’ etc ) in SQL SERVER ; only update the required fields not all the fields when using INSERT/UPDATE SQL statements from external applications
If you are interested we can discuss in details thanks0 -
So, if an external Application, like an php script or a C++ programm, writes datas in a NAV table where a Date is set,
these programm must fill the datefield with the value: 1753-01-01 00:00:00.000.
the reason: No Field could be NULLDo you make it right, it works too!0 -
An external applicaton can write any information into the Sql Table as long as it follows the rules of SQL Server/ Table/Column Type. Sql Server Table/Column does not care about the Navision Rules set inside the Nav Program. The issue is when you try to open the same table inside Navision, then Navision will not allow you to open the table; it will give you some invalid data error, if it finds some invaild navision type data in the table. That is why I said, before update (insert/update) any values from external application into the Sql server (Navision table) you should programatically test the navision validity of the data.0
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