How to autofill today's date in a service catalog field

katelynlassan
Kilo Contributor

I am using a "Single Line Text" variable. I would like to know how to pull the current date to auto fill in this field. I have tried a few different client scripts, but cannot get this to work. I have very little knowledge on scripting.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Have you tried the default value in the catalog item definition?



javascript:gs.nowDateTime()


View solution in original post

5 REPLIES 5

Chuck Tomasi
Tera Patron

Have you tried the default value in the catalog item definition?



javascript:gs.nowDateTime()


Hi Chuck,



We have a custom date (u_create_date) field which needs to inherit the date value from the OOB sys_created_on (Date/Time) field in user's time zone.


Also, value of the custom date should match with the value of the date stored on the sys_created_on field.



EX: If an user in PST timezone has created a record on Dec 07 2016   22:00:00   PST then when an user from Hong kong time zone views


this record he should see the value of the custom date field according to his time zone.



Thanks,


BALAJI40
Mega Sage

under configure dictionary, default value


javascript: gs.nowDateTime(), if you need only date javascript: gs.now()


Gangadhar Ravi
Giga Sage
Giga Sage

You can use javascript:gs.now() as default value.




Thanks,




Sai.