Hide Day from Duration variable

PiotrekL
Tera Expert

Hi

 

I want to remove days and seconds in the catalog item as shown in the attachment.

 

I tried code from: https://www.servicenow.com/community/developer-forum/show-hours-only-in-duration/m-p/1598089

but I have an error :" ErrorThere is a JavaScript error in your browser console"

when I removed ownerDocument it disappeared but code is not working. 

 

Is there any other possibility to remove this?

reagrds

Piotr

1 ACCEPTED SOLUTION

Anand2799
Giga Guru

Hi @PiotrekL ,

 

OOB you can show the maximum unit you want users to enter. You can use max_unit=days in variable attribute to remove days.

Anand2799_1-1758888721674.png

 

Anand2799_0-1758888716159.png

Service Catalog variable attributes

 

Thanks

Anand

 

 

View solution in original post

3 REPLIES 3

Anand2799
Giga Guru

Hi @PiotrekL ,

 

OOB you can show the maximum unit you want users to enter. You can use max_unit=days in variable attribute to remove days.

Anand2799_1-1758888721674.png

 

Anand2799_0-1758888716159.png

Service Catalog variable attributes

 

Thanks

Anand

 

 

Hi

 

This one woks but without removing seconds.  But I agreed that seconds might be there

 

Regards

Piotr