On form two dates field , if date1 is not equal to date2 the string field should populate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 06:08 AM
Hi All,
On form two dates field , if data1 is not equal to date2 the string field should populate.
Thanks in Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 06:24 AM
Hi @vipuljay ,
You can create onLoad client script and it will check both two dates you can refer below script
var dateOne = g_form.getValue('date_one') // backend name of date_one
var dateTwo= g_form.getValue('date_two') // backend name of date_two
if(dateOne == dateTwo){
Add code here as per requirment
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 06:39 AM
Hi @Community Alums,
Thanks for the quick response,
I tried your code but i was not able to populate a string field, can you please help with it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 10:06 AM
Hi @vipuljay ,
I tried your problem in my PDI it works for me
I created onLoad client script and added below code
function onLoad() {
//Type appropriate comment here, and begin script below
var start = g_form.getValue('start_date');
var endDate = g_form.getValue('end_date');
alert('start = ' + start);
alert('endDate = ' + endDate);
if(start == endDate){
alert('both Same');
}else{
alert('No Same');
}
}
Result
Note: GlideDateTime api is not work here in client script if you want to work with GlideDateTime we need to do a AJAX call. Please let me know if you want that code.
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak