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.
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)
;-) 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.
;-) 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.
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 thanks
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.
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.
Comments
DateField := 31121977D; //or workdate or today <- both are system constants
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.
http://www.BiloBeauty.com
http://www.autismspeaks.org
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)
Regards
Not on Tuesdays and Wednesdays you don't :shock:
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 sometimes
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.
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 thanks
these programm must fill the datefield with the value: 1753-01-01 00:00:00.000.
the reason: No Field could be NULL