Field Customization with Date AND Time

 
Author
Message
SysAider
41
 
I have created some custom date fields which allow only mm/dd/yyyy, but I want the fields to include both the date AND the time (HH:mm).
Anyone know how to do this?
SysAider
41
 
Reply from a submitted request.

Thank you for contacting SysAid Customer Relations.

Unfortunately, in the out-of-the-box version of SysAid, there is no possibility to add such a field type. If you would like, I can forward this request to the Profesional Services team and check if they can create a custom solution for you. Keep in mind that this might imply additional fees.

Kindly let us know your thoughts on this matter.
Thank you for your time and have a great day!

Best Regards,

Vladut Adrian Prelipcean
Customer Support Engineer
SysAider
41
 
My workaround was to create a separate text field for the time.
I did this and included notifications in the workflow which referenced these fields.
Guess what?
These fields do include the Date AND Time, contrary to the "engineer" who replied. (See attached screenshot which shows the display of the time.)
I'm assuming (given the responses thus far) that not only is it not possible to EDIT the value for time in this field, but that it is also not possible to not display the time in a notification, which would be desirable since this value is not editable and thus not useful.

I could write pages about my dissatisfaction with this result, but since it would only receive the reply,
If you would like, I can forward this request to the Professional Services team and check if they can create a custom solution for you. Keep in mind that this might imply additional fees.

And wait 7+ years for a reply, I don't think I will bother.
SysAider
41
 
I received the following reply from a different SysAid Support Engineer.
This solution does accomplish my end goal.


To add a custom date and time field, please go to Settings >> Customize > Fields Customization >> Service Record >> Add a new custom column >> Field Type: Date >> Apply >> Advanced >> search for the formats MM/dd/yyyy or dd-MM-yyyy and make sure that each of them to are set to MM/dd/yyyy HH:mm:ss or dd-MM-yyyy HH:mm:ss (that includes all of the boxes where available).

Next, change all the lines containing 'new calendar' to 'true' instead of 'false'.

Next, remove the 'Display in List' and change it to the below:

import java.text.SimpleDateFormat;
import java.sql.Timestamp;
import java.util.Date;
Timestamp timeStemp = rs.getTimestamp("sr_cust_occurred");
//return (timeStemp!=null ? dateOnlyformat.format(new java.util.Date(timeStemp.getTime())) : "");
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
return format.format(timeStemp.getTime());

The text sr_cust_occurred from the above needs to be changed with the value of the fields' DB Field Name from the General Tab.

Once done, the date and time field should appear correctly on both the details page of the SR and on the List view of the field.


Many thanks to Felicia!
SysAider
6
 
Was this on-prem, or in the cloud? I'm in the cloud and can't seem to see what you are referring to when you say "search for the formats MM/dd/yyyy or dd-MM-yyyy."

Thanks!
SysAider
41
 
We have an on premises implementation.
I am unfamiliar with the cloud version.

In the on-prem version, under Field Customization, after creating a new Date field, you have to go to the Advanced tab and change all of the references to the date which are date only values (dd-MM-yyyy and MM/dd/yyyy) to include the time values as well (add "HH:mm:ss"). Also the statements referencing "new calendar" must be changed from false to true.
There are several occurrences of each on this page.

I have attached a screenshot which I hope clarifies this and/or at least shows you what the page that these instructions reference looks like.

SysAider
6
 
Thanks for the quick reply, I appreciate it. Looks like this is only available on-prem then, unless I'm missing something. Those fields are all locked out, as shown in the attached image.

SysAider
3
 
I reported the issue (cloud version) with custom dates displaying a non-existent time. They logged this bug and provided the below update back in July, still no word of any further progress.

Bug 17060 - SR 1922130: Backlog - recently updated by product to push to R&D to investigate
SysAider
41
 
rbeaton,
I would have to agree. Your screenshot looks very different from what I see in the on-prem version.
Sorry I couldn't be of more help.
SysAider
6
 
No worries, I appreciate the info. This seems like a pretty basic thing that I'm surprised isn't already implemented. It sounds like it's been requested for quite a while.
SysAider
41
 
This method has worked successfully to create custom date fields in SR forms and in the SR list; HOWEVER, it consistently fails to add the time in a Report (Analytics>Reports).
Out-of-the-box date fields do include both the date and time in a field in a report, so it is not a limitation of the report display.

How do I update custom date fields so that they display both the date and time in a report?