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.

Auto Populate Actual Date with current date

Ponda
Tera Contributor

Hi 

 

How can I auto populate the actual end date field on the change form upon selecting the cancel change button

 

In other words, I did like for that to auto populate with current date when I select cancel change to cancel the change request

And I want to make this button only visible in the implement state and only visible to change implementers

Ponda_0-1695678573076.png

 

1 ACCEPTED SOLUTION

_William_Knight
Kilo Guru

This worked for me 

current.work_end = gs.nowDateTime();

current.update();

View solution in original post

9 REPLIES 9

Hi @Ponda 

 

Try to put your line of code before "current.update()"

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

you need to put line no 14 and 15 before line no 11 i.e current.update(). // this line will update your current record

Regards
Harish

_William_Knight
Kilo Guru

This worked for me 

current.work_end = gs.nowDateTime();

current.update();

I want to autopopulate start date in change form when the implement button is clicked, what can i do?

Ponda
Tera Contributor

Most appreciated fellows! the below worked like a charm

 

current.work_end = gs.nowDateRime();

current.update();