Microflow expression error at Change object activity using DateTime

Hi community! First some context: In our project, we are receiving orders from an external system that contain a ValidFrom and a ValidTo DateTime-attribute. If the order is infinitely valid, the ValidTo attribute will be set to 2999-12-30. In our application, we interpret this as an order without an end date and should translate this so that the ValidTo attribute is empty and our Boolean attribute NoEndDate is set to true. Now the problem: I am trying to incorporate this in our model using a Change object activity where the following statement is used to empty the ValidTo attribute when the incoming value is set to 2999-12-30: if $IncomingOperatorOrder/ValidTo >= parseDateTimeUTC('30-12-2999','dd-MM-yyyy')     then empty     else $IncomingOperatorOrder/ValidTo However, using this statement, Mendix returns an error: com.mendix.modules.microflowengine.MicroflowException: Failed to evaluate expression, error occurred on line 1, character 1 $IncomingOperatorOrder/ValidTo >= parseDateTimeUTC('30-12-2999','dd-MM-yyyy') ^     at ReceiveOperatorOrder.SUB_QueueOO_ImportOrder (Change : 'Change 'IncomingOperatorOrder' (ValidTo, NoEndDate)')     at ReceiveOperatorOrder.ACT_QueueOrder_CreateTestorder (SubMicroflow : 'SUB_QueueOO_ImportOrder') Advanced stacktrace:     at com.mendix.languages.mxexpressions.MxExpression.evaluate(MxExpression.scala:35) Caused by: com.mendix.languages.expressions.ExpressionException: java.lang.IllegalArgumentException: Left and right hand side of binary expression should not be empty     at com.mendix.languages.expressions.Expr.evaluate(Expr.scala:16)   Nevertheless, when I put the exact same statement in a separate variable, it returns the expected result (aka the statement itself works). It seems then, that it cannot change the ValidTo attribute for some reason (and yes, I’ve also incorporated a check whether the ValidTo attribute is initially empty or not).   Can someone perhaps shed some light on why I cannot use this expression to perform my desired Change activity? :)   Thank you in advance!
1 answers


Try with this,

if $IncomingOperatorOrder/ValidTo  = empty
then empty
else if $IncomingOperatorOrder/ValidTo >= parseDateTimeUTC('30-12-2999','dd-MM-yyyy')
    then empty
    else $IncomingOperatorOrder/ValidTo

The problem is your $IncomingOperatorOrder/ValidTo is most likely empty.