Any Alternative for getDateFromFormat to use in Service Operation Workspace ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 01:53 AM
Hi ,
i have a requirement to to check if the selected date field in (check_date) is less than Opened date and greater than today ,
I need to show an error message..
It's working as expected in the Backend view but in the Service operation workspace, I see an error message shown - " getDateFromFormat is not defined "
Script -
Onchange of check_date
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var openedDate = new Date(getDateFromFormat(g_form.getValue('opened_at'), g_user_date_time_format));
var checkDate= new Date(getDateFromFormat(newValue, g_user_date_time_format));
var today = new Date();
if (checkDate< openedDate) {
g_form.clearValue('check_date');
g_form.showFieldMsg('check_date', getMessage('check_date.info.message'), 'error');
} else if (checkDate> today) {
g_form.clearValue('check_date');
g_form.showFieldMsg('check_date', getMessage('check_date.aftertoday.info.message'), 'error');
}
}
Does anyone encountered this issue in Workspace?
Can anyone suggest what would be other alternative to use instead of getDateFromFormat in this script
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 02:00 AM
Hi,
This sounds like something you could resolve without the use of scripting.
Take a look at this article by Mark Roethof.