Hi,
Is it possible to show only hours and minutes in a Time field on a Page. So the SmallDateTime Datatype of SQL.
On a form you can fill the format property, but on a page this is not possible.
So not fill it with code but just fill it manually and then only show hours and minutes.
0
Comments
Example: You have a Time-Field "Starting Time" which should be displayed as "12:59":
Instead of entering Source Expression: "Starting Time"
Enter Source expression: FORMAT("Starting Time", 5)
But before you do so, make sure you save the CaptionML as NAV will replace your Caption with something like "<Control1000000009>"
Marcus Fabian
This is just one of the many features Microsoft kicked for no (apparent) reason. If at least they had kept the OnFormat trigger ...
To make it editable, you have to declare a global Text variable and include it in the dataset. Then OnAfterGetRecord you need to assign to it using FORMAT. OnValidate you need to evaluate your text to your time field and reformat you text variable. If you want to get the TIME-functionality (entering t (or your localized version) to get the current time), you will have to call the corresponding function in Codeunit 1 (MakeTimeText).
The length of the time field in the page will correspond to the declared length of the text variable. This alone might turn the balance in favor of the more cumbersome text variable approach.
Thx for the info, could you explain more this last statement?