- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 05:23 AM
I have created a Record producer and used the below script to populate the field values except for the Opened field, the opened field has to be updated with the created on date.
Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 05:52 AM
Hello @GBS ,
You can write the script like below.
current.u_opened=gs.nowDateTime();
Please refer the below links as well.
https://www.servicenow.com/community/developer-forum/how-to-set-current-date-and-time/m-p/2223464
Please mark my answer as correct and helpful if it helps you.
Regards,
Namrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 05:51 AM
Your 'created on' will be set at insert of the record, so there is no createdOn to set your u_opened field with. I would use an async BR to update the field after insert. It's created from the portal and the second it takes to update the field, won't be noticed by anyone.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 05:52 AM
Hello @GBS ,
You can write the script like below.
current.u_opened=gs.nowDateTime();
Please refer the below links as well.
https://www.servicenow.com/community/developer-forum/how-to-set-current-date-and-time/m-p/2223464
Please mark my answer as correct and helpful if it helps you.
Regards,
Namrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 05:56 AM
@Namrata Ghorpad Thanks, it worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 06:18 AM
Hello @GBS ,
Please refer below articles:
https://www.servicenow.com/community/itsm-forum/wants-to-update-the-opened-date-filed-as-created-dat...
https://www.servicenow.com/community/developer-forum/field-with-today-s-date-on-record-producer/m-p/...
https://www.servicenow.com/community/developer-forum/how-to-set-current-date-and-time/m-p/2223464
https://www.servicenow.com/community/developer-forum/how-to-auto-populate-date-field-on-record-produ...
Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!
Thank you!!
Dnyaneshwaree Satpute
Tera Guru