- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 11:00 AM
I need to populate the current date and time in the below attached variables when perform restart immediately is checked. Please suggest
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 03:39 AM
Hi @Archana23
Please Create a new Catalog Client Script or do modifications in your catalog client script as I mentioned below, This will solves your Query:
Create a Catalog Client Script
Name :
Applies to : A Catalog Item
UI Type : Desktop/ All
Type: onChange
Catalog Item: Select your Catalog Item
Variable name: Perform Restart Immediately
Applies on Catalog Item View : Tick
if(newValue === 'true') {
var now = new Date();
var fDT = now.toISOString();
g_form.setValue('variable1name' , fDT);
g_form.setValue('variable2name' , fDT);
}
//change variable name according to your current variable name.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will helps us a lot.
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 01:38 PM - edited 03-14-2024 01:41 PM
Hi @Archana23 ,
Write onChange client script on checkbox ( catalog client script for catalog item ) and set current date to these two variable using g_form.setValue(<fieldName>, <fieldValue> );
Try this code in client script
var date = new Date();
var dateTime_str = formatDate(date, g_user_date_time_format);
alert(dateTime);
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 10:44 PM
Can you please let me know where I am missing here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 02:42 AM
alert is giving expected result or not ?
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 02:59 AM
No, the alert is not displaying in the form.