- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2018 11:32 PM
Hi all,
I have a requirement where in I need to create a script include which returns the current date and time to the client script. I have created a field 'date' on the incident form, it should update the field with the current date when the incident is created.
Thanks for the help in advance.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2018 12:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2018 11:48 PM
Hi,
For this you can create a Before insert business rule and set your filed to
current.yourfield=gs.now(); //set only date without time and gs.nowDateTime() full datetime
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2018 11:56 PM
you can also
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2018 12:14 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2018 01:55 AM
Hi,
Script Include-which will return current date time using GlideDateTime API. use method object name.getLocalTime()
write client script to parse that time.
write call back function
function callback(response)
{
var answer1=response.responseXML.documentElement.getAttribute('answer');
var a=answer1.split(" ");
var time=a[1];
var time1=time.split(":");
var hour=time1[0];
var minute=time1[1];
var second=time1[2];
var time=hour+"/"+minute+"/"+second; //set this date to particular time field;
Thank You