- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 01:37 AM
Hi Team,
Can you please help me - attached script what is the result of it.
if there is any possible to keep start time & end time should not accept. how add this step in below script.
Onchange clientscript:-
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 04:17 AM - edited 02-22-2023 04:22 AM
Hi @babbi ,
In the same onChange script add the below line of scripts and shown in image.
var startDate = g_form.getValue('start_date');
var endDate = g_form.getValue('end_date');
if (startDate == endDate) {
var errorMessage = "Planned end date must be after Planned Start Date";
g_form.clearValue('end_date');
g_form.showErrorBox("end_date", errorMessage);
return false;
}
Mark helpful and accept the solution if it helps in solving your query.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 04:31 AM
Try this
var start = g_form.getValue('start_date');
var end = g_form.getValue('end_date');
if(start == end){
var errorMessage = "Planned end date must be after Planned Start Date";
g_form.showErrorBox("end_date", errorMessage);
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 02:26 AM
Hi @babbi ,
I didn't quite understand your requirement.
Do you need the start date and end date not to be the same value for a Change Record?
Can you explain in more detail with an example?
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 02:32 AM
Hi @Johns Marokky,
Can you please help me urgnt requirement - in change request Planned start date time and Planned end date time is should not be accecpt ( same date is fine - But the end time must be different compare to start time).
How can we acheive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 03:51 AM
Hi,
You can prepare a script onchange which will check the end date/time with start date/time and if the time is same then it will throw the error. I am preparing the script and will send you soon.
Regards,
Shamma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 04:17 AM - edited 02-22-2023 04:22 AM
Hi @babbi ,
In the same onChange script add the below line of scripts and shown in image.
var startDate = g_form.getValue('start_date');
var endDate = g_form.getValue('end_date');
if (startDate == endDate) {
var errorMessage = "Planned end date must be after Planned Start Date";
g_form.clearValue('end_date');
g_form.showErrorBox("end_date", errorMessage);
return false;
}
Mark helpful and accept the solution if it helps in solving your query.
Regards,
Johns