AnsweredAssumed Answered

JavaScript Function Error

Question asked by TimNeumark118 on Aug 8, 2011
Latest reply on Jan 6, 2018 by mmorthala189353
This map function is rather basic JavaScript, but it fails with the error:<br /> <br /> <strong>First document failure: [Function: Compare DateTime to Now, Scripting]: Error executing custom script: java.lang.NullPointerException; Caused by: java.lang.NullPointerException<br /> <br /> </strong>Why would this fail? It works in a browser, but not in Boomi. Function below:<br /> <br /> <div>var d1 = Date.parse( dt1 );</div> <div>var d2 = new Date();</div> <div>var t = d2.getTime();</div> <div> </div> <div>if ( d1 == t )</div> <div>  output = 0;</div> <div>else if ( d1 &gt; t )</div> <div>  output = 1;</div> <div>else</div> <div>  output = 2;</div>

Outcomes