- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 04:59 AM
I want to set today's date field automatically , when i opened the new form and same as with time so i have created two seperate fields for date and time those are need to be filled automatically when i open the new form could any one please help me....?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2018 12:33 AM
If you want to use current time and date on different tables, the use this script include:
var MyDateTimeAjax = Class.create();
MyDateTimeAjax.prototype = Object.extendsObject(AbstractAjaxProcessor,
{
nowDateTime: function ()
{
return gs.nowDateTime(); }
});
call this S.I in onload client script:
var ajax = new GlideAjax('MyDateTimeAjax');
ajax.addParam('sysparm_name', 'nowDateTime');
ajax.getXML(function ()
{
g_form.setValue('put your field name here', ajax.getAnswer());
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 07:20 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 07:32 AM
Thank you. I made my glide_time field read-only (at the dictionary level) and found that the client script could not set it either. The workaround I had was to make the field editable (uncheck Read-only on the field's dictionary entry) and use the client script to set it to read-only after the value was set like this:
function onLoad() {
if (g_form.getValue('start_date') == '') {
g_form.setValue('start_date', g_scratchpad.start_date);
}
if (g_form.getValue('start_time') == '00:00:00') {
g_form.setValue('start_time', g_scratchpad.start_time);
}
g_form.setReadOnly('start_time', true);
}
If the Read only field on the dictionary is already unchecked, then check our ACLs to provide write access to that field. That's the only way the client script is going to be able to write a value there is if the field is editable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 07:41 AM
Ya now it is working Once Again Thank you and thank you for your patience Chuck Tomasi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 07:46 AM
You are welcome.
In the spirit of community... please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2018 12:31 AM
try display business rule:
current.your specified field = gs.nowDateTime();