Starting from MBS-Navision 3.60, there is a datatype called DATETIME:
Use this data type to denote the date and time of day.
The datetime is stored in the database as Coordinated Universal Time (UTC).
UTC is the international time standard (formerly Greenwich Mean Time, or GMT). Zero hours UTC is midnight at 0 degrees longitude.
The datetime is always displayed as local time in Navision Attain.
Local time is determined by the time zone regional settings used by your computer.
You must always enter datetimes as local time. When you enter a datetime as local time, it is converted to UTC using the current settings for the time zone and daylight saving time.
But I doubt this can be used to fill in the date/time in Outlook. Never tried it.
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Navision has own date and time types: type DATE and type TIME. Outlook and MS SQL Server have common DATETIME type called DATE which consist of DATE and TYPE.
Question: How I can extract 'time' from DATE type in Outlook or SQL Server and use it in Navision? :?:
Navision version 3.60 and later has new data type - DateTime. This data type was created to cooperate with Automation and OCX.
When you wish to work with Outlook automation or OCX, simply create variable type DateTime and use it to acquire value from automation to Navision. When you have DateTime filled with value from Outlook, you can use functions DT2DATE to extract date from datetime and DT2TIME to extract time from datetime
example:
dtDatetime = datetime variable
autAutomation = automation variable
datDate = date variable
timTime = time variable
/// get datetime from automation
dtDateTime := autAutomation.function
/// converting to date and time variables
datDate := DT2DATE(dtDatetime);
timTime := DT2TIME(dtDateTime);
/// that is all
When using SQL date type, I think, that date part of datetime is filled and time part is blank.
Big thanx for all!
But this solution is ideal for Navision 3.60, but I need solution for Attain 3.10?
I faced the same problem in 3.10, so I created a DLL in VB which I called with the parameters Outlook object and a Date and Time, which updated the object in Outlook.
The same DLL I used the other way to get Date and Time from Outlook into Navision.
Comments
Question: How I can extract 'time' from DATE type in Outlook or SQL Server and use it in Navision? :?:
When you wish to work with Outlook automation or OCX, simply create variable type DateTime and use it to acquire value from automation to Navision. When you have DateTime filled with value from Outlook, you can use functions DT2DATE to extract date from datetime and DT2TIME to extract time from datetime
example:
When using SQL date type, I think, that date part of datetime is filled and time part is blank.
I hope this helps you :-)
Keep smiling :P
But this solution is ideal for Navision 3.60, but I need solution for Attain 3.10?
As I said at NOLUG
I faced the same problem in 3.10, so I created a DLL in VB which I called with the parameters Outlook object and a Date and Time, which updated the object in Outlook.
The same DLL I used the other way to get Date and Time from Outlook into Navision.
I use the following instruction in SQL
Date+ CONVERT(CHAR, Time, 8) AS DateTime
where CONVERT(CHAR,Time,8) extracts the time from a DateTime field