[SOLVED] Don't Expressions work in V5? Yes they do!

Hi All,
I’ve followed the tutorial below and I can’t seem to get it working. If I replace the expression with [=2+5] I get 7 as expected, but this [=FD(ADM(‘{TICKET DATE}’,-216),‘dd/MM/yyyy’)] doesn’t work at all. Any ideas why? My initial thought was that V5 doesn’t support expressions, but that doesn’t sound very likely.

I’m currently just trying to do it on an automation command button within the till system. When that works, I’ll set it up for all age restricted items in the system.

Thanks,
Bryn

I’ve tested and [=FD(ADM('{TICKET DATE}',-216),'dd/MM/yyyy')] expression works fine. However unlike V4, V5 expression engine uses system date time format for date conversions. That might be your issue. Try changing Local Settings > Override Windows Regional Settings or if it is different try changing your system date format.

Hi Emre,
Thanks for your super speedy response.
Please see below. If I change that to [=2+3] then it works (message box comes up with 5). With the expression in the screenshot, nothing comes up, not even a blank message.

I’ve just checked, and my system is set to dd/MM/yyyy and I have selected the box you suggested to override Windows Regional Settings. Still no luck. Are there any other functions that I could maybe try to rule out a date settings problem?

Thanks,
Bryn

Don’t put it in the action. Instead use a variable in action like [:Message]. Then in the rule with that action put your expression.

Expressions typically only work if used in rule as parameter not directly in action.

Edit: dang Emre I noticed it right after I typed my first response. I was trying to beat you to it with an edit. You win lol.

1 Like

Try configuring message as a variable like [:Message] and set expression inside rule.

Like this?


No. For message variable you should see a new editing area under constraint.

Remove Age Check 2 action, save rule and add action again.

Gotcha. That’s working now. Thank you so much.
The system is great, but my god, there’s an awful lot to learn.

Bryn

2 Likes