How to default a text box to display current year
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2016 09:27 AM
How to default a text box to display current year.
Thanks,
Anji
Labels:
11 REPLIES 11
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2016 09:41 AM
You can use an javascript object to get year. Create an onLoad client script and add this code to update a field say 'abc'
var today = new Date();
var year = today.getFullYear();
g_form.setValue('abc',year);
Mateen

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2016 10:24 AM
Hi Anji,
In the default option you can add the value as below :
javascript:(new GlideDateTime()).getYear();
Hit Like/Helpful/Correct, if applicable.