failing to evaluate microflow expression

0
An error has occurred while handling the request. [User 'Anonymous_c8200fc8-e67e-428d-a8b1-9fca18617848' with roles 'Administrator'] com.mendix.core.CoreRuntimeException: An error occurred while executing the action 'MyFirstModule.calculateage' at ij.getValue(SourceFile:204) Caused by: lg: Failed to evaluate expression, error occurred on line 1, character 7 round(daysBetween($Employee/DateofBirth,[%CurrentDateTime%])) ^ at MyFirstModule.calculateage (End : '') Advanced stacktrace: at jJ.a(SourceFile:20) Caused by: jC: jC: java.lang.NullPointerException at jB.b(SourceFile:34) Caused by: jC: java.lang.NullPointerException at jB.b(SourceFile:38) Caused by: java.lang.NullPointerException at jz.g(SourceFile:151) at jz.e(SourceFile:139) at jD.a(SourceFile:135) at jB.b(SourceFile:30) at jD.a(SourceFile:226) at jD.a(SourceFile:51) at jB.b(SourceFile:30) at jJ.a(SourceFile:16) at mq.a(SourceFile:33) at ms.a(SourceFile:151) at ms.executeAction(SourceFile:98) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:207) at com.mendix.core.Core.execute(SourceFile:226) at ij.getValue(SourceFile:200) at ij.parseValueToString(SourceFile:269) at jl.a(SourceFile:322) at jl.a(SourceFile:276) at jl.a(SourceFile:255) at jl.a(SourceFile:220) at jl.a(SourceFile:205) at jl.a(SourceFile:143) at jl.a(SourceFile:84) at jf.a(SourceFile:48) at jd.a(SourceFile:321) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:170) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:161) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:160) at akka.actor.Actor$class.apply(Actor.scala:545) at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:156) at akka.actor.LocalActorRef.invoke(ActorRef.scala:910) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192) i am also having problem executing other expressions like "formatDateTime","substring"... etc... each of them showing "json is incorrect".... what seems to be the problem.... the input and output datatypes are correctly set..
asked
2 answers
0

You probably did not handle an empty value of $Employee/DateOfBirth. Set a breakpoint and evaluate the dates before the expression.

Regards,

Ronald

answered
0

You need to check both the object and the attribute of the object for null values before performing a function (i.e. $Employee, and subsequently, $Employee/DateOfBirth).

answered