How to show full duration value in a read-only field?

MG Casey
Mega Sage

Let's say I've got 4 duration fields:

find_real_file.png

The user needs to be able to see them, but cannot edit them. When they become read-only fields, it seems to round off the seconds when there's at least a minute showing:

find_real_file.png

Any ideas on how to show the full duration value to the user (while still keeping the field read-only)?

1 ACCEPTED SOLUTION

If you want to go through the effort of a UI macro/formatter, sure. That would work.



Be sure your organization/customer are willing to take on the burden of supporting the custom code. The input we're getting from a   lot of customers is "Gee, I wish we hadn't customized so much. It's making upgrades really hard."



Also keep in mind that your UI macro won't work on Service Portal.


View solution in original post

6 REPLIES 6

Chuck Tomasi
Tera Patron

You could use an onLoad client script to make it read-only.


find_real_file.png



The issue is that you lose the labels of each section.


find_real_file.png


Definitely not a bad idea, though it will probably cause more questions from employees than the previous way.



It might just have to display those field values using a UI Macro sounds like.


If you want to go through the effort of a UI macro/formatter, sure. That would work.



Be sure your organization/customer are willing to take on the burden of supporting the custom code. The input we're getting from a   lot of customers is "Gee, I wish we hadn't customized so much. It's making upgrades really hard."



Also keep in mind that your UI macro won't work on Service Portal.


Very true - yep, we've had other requirements that force us to utilize UI Macros, but knowing the Service Portal implication is important too. We're not utilizing Service Portal at this point, but hopefully when we get to that point, the forms in ServiceNow and the forms in Service Portal are a bit more lined up in what can be used in both. (For example, the ability to use a widget variable in a regular SN form so that there's no need to use a UI Macro). But that's another topic.