- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2018 07:20 AM
Hi,
I would like to set default values for few fields through script in record producer which is mapped to same field name into a parent table.
Can someone please help here?
Regards,
Alok
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2018 10:53 AM
You could do an onload script to set the value.
g_form.setValue('variable', 'value');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2018 07:25 AM
Instead of doing it thought a script why would you not use add the default value on the variable in the record producer? Or if the incident is always supposed to use the default values leave them off the record producer and let the default values in the incident table take care of it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2022 08:48 AM
This is an old post but hopefully it will still be checked 😉
I am having difficulties understanding the syntax for default values of Record Producer variables.
What I want to achieve it to populate the default value with today at 8 in the morning.
I have tried with javascript:gs.nowDateTime("2020-01-01 08:00:00") as a mean of testing but that set the value to my current date time.
Any ideas?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2022 09:03 AM
Try javascript: new GlideDateTime("2020-01-01 08:00:00");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2022 09:13 AM
I have done that
javascript:gs.dateGenerate(gs.now().substring(0,10), "08:00:00")
maybe not the most simple but does the job 😉
Thanks