ui page client script not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 05:49 PM
Hi All,
SITUATION
I am trying to simulate the time worked form with a ui page.
I created a ui action (button) that calls the page. the it staff enters details and time. Then, record is added to task_time_worked table.
PROBLEM
The original problem is that totalSeconds contains the time in seconds but when inserted does not have in consideration that snow works with different time (1970-01-01 00:00:00) and when inserting record looks like '2023 28-11 06:00:00'. Then, when looking at the time worked form shows 19690 days 1 hour 20 mins.
Today i added a script include called from the client script section and at the end shows the right value '1970-01-01 00:01:30', but i dont know how to assigned it to the 'time_worked' variable so it is inserted in the duration field within the 'task_time_worked' table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 11:02 PM
Hi @El Cuchi
The Duration field type is expecting the value in the format "ddd hh:mm:ss." After your calculation, ensure that you return the duration in this format. Set this formatted value for the duration field, and it should work.
Ref: Calculate difference bet two dates and set duration.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 04:27 PM
This is how i solved my problem.
I passed all values to the script include where i calculate the time work field and now i also insert the record in the script include rather than returning the duration to the ui page and try to insert it from there.
thanks all !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 04:29 PM
i just solved the problem by not only passing the duration value to the script include but also passing all values. Also i do the insert from the script include rather than trying in the client script within the ui page.
thanks all !!