date validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 06:07 PM
Hi
I have written the code in wait for conditon in servicenow but I am getting the error as "class java.lang.Boolean cannot be cast to class java.lang.String (java.lang.Boolean and java.lang.String are in module java.base of loader 'bootstrap')"
// Retrieve departure date from the catalog item
var currentdate = String(new GlideDateTime().getDate());
var releasedate=fd_data._1__get_catalog_variables.start_date;
gs.info("the start date is"+releasedate);
gs.info("the type is "+typeof(releasedate));//string
return currentdate==releasedate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 09:04 PM
Could you please let me know the type of catalog variable "start_date" ? Also, can you please share the complete script which you are using in the wait for condition.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 11:05 PM
Hi @SAI VENKATESH ,
Why are you converting current date to string? Please share complete code which you are using in the wait for condition or share the requirements you want to achieve.
Please mark my answer helpful and accept as a solution if it helped 👍✔️
Kavita Bhojane