Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to set current date time in scoped application

jerryzhou
Kilo Explorer

Hi,

  I need to set the current time stamp into a date/time field in a scoped application,what is the best way to do it? I though it would be simply to set it as the same as Updated system field, but it seems not working, did I miss some thing?

Thanks for help!

Jerry

2 REPLIES 2

gauravchoudhury
Tera Guru

Hi Jerry,



You can get this done with a Business Rule.



Please refer to this link for your reference.


AnnaMermer
Kilo Contributor

Jerry,

You can set the current date-time in a scoped as using the following:

var dateTimeNow = new GlideDateTime().getDisplayValue();

current.[yourfieldname] = dateTimeNow;

 

Hope this helps!

Anna