Easy and accurate time data entry?

jdesmm

Well Known Member
I'm designing an application in which users need to record a start and stop time for a process. This information will be recorded after the fact, so I can't do a simple GetAuditInfo or the like to populate the time fields. Also, the users are only interested in recording hours and minutes, not seconds.

Using a standard time field, like TDAY, the user would typically have to enter 5 or 6 digits to generate a time like 10:30:00 (when the numeric time is run through a time formatting function, like Format Time with Colons). I don't want to require them to enter that many digits, but if they just enter 10 or 1030, JDE will process those times as 10 seconds and 10 minutes, 30 seconds respectively.

Rather than trying to write code to count digits and attempt to handle every possible way in which a user might enter hours/minutes, I wanted to use a text field and set up masking. In other tools I've used, this is usually accomplished quite easily. First, I tried using DD item FTIME and overriding its display to MASK and bb:bb:bb (as per the documentation). This had no effect, and I decided I'd rather shrink it down anyway, so I made a custom DD item with 5 characters and set its MASK in the DD to bb:bb. Again, no effect.

Now, what I can do using the new DD field (or any text field really), is to check for blanks/nulls in the Write Grid Line-Before form event and populate the grid control with 00:00 if it's blank, which provides something like a mask for entry. But what I'd rather have happen is to allow the user to type in 1030 and have the mask automatically add in the colon in the appropriate position. It seems like I'm either not understanding/using the MASK functionality properly, or there is a bug with it.

If anyone has any suggestions on using MASK to achieve the functionality I'm looking for or has alternative methods of setting up data entry time fields that are easy for the user and allow accurate recording of times, I'd appreciate it. Note that I've also thought of having one field for entering hours and a second for entering minutes; I just don't like forcing the user to split up what should be a straight forward single entry.
 
Hi,

I created one new DD item (String with length 8).Using text functions I have calculated the length of the data entered and based on which I added Colons and zeros.It worked Well.
Please find the attachment for the code .

Thank you,
Anjali
 

Attachments

  • 110499-Time Entry.txt
    1.3 KB · Views: 112
Hi shelley
Is the reply from anjali suffices your requirement.?
I have a question here ,,,how does your user enters the time 02:04 and when 10 is entered does that mean 10 hours or 10 minutes?
Thanks
Vinny
 
An update on this question. I submitted a case to Oracle and was informed that the MASK format is a World only concept; even though it's in OneWorld, it serves no function there. So I was forced to code for the basic behavior I wanted. It's not quite the same as what Anjali posted but it's along similar lines.

For Vinny, yes, I had to make certain assumptions about the user's intention in entering something like 10. I am interpreting that to be 10:00, not 00:10. As soon as they've made the entry, the code formats the field to the time as it interprets it, so the user can always correct it, if it did not interpret their entry quite as they expected.
 
Back
Top