The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe

Questions

 
1
0
-1

Hello,

I've got an error as below:
"Cannot cast object '2020-12-03 13:43:48' with class 'java.lang.String' to class 'java.util.Date' "


It appeared after I added to SN outoging sync rule line:


replica.created = incident.u_reported_date_time


SN incoming sync rule line looks as below:


incident.u_reported_date_time = replica.created


In SN field u_reported_date_time is a date/time type.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Andrew


      The string needs to be converted to date
      Always a good testbed to try out groovy scripts is 
      https://groovyconsole.appspot.com/

      Check out following code

      Untested
      import java.text.SimpleDateFormat
      
      def sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss")
      Date date = sdf.parse("2020-12-03 13:43:48")
      
      
      print "Date = ${date​​​​​​​​​​​​​}"​
      


      Results in


        CommentAdd your comment...
      You are evaluating Refined.