Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking for a week number in a workflow expression
#8
I have the weirdest thing here:

I created some workflow expressions, none of them worked. I created this one just for testing:
Code:
if salesorder_no == 'ORD1800484' then 'A' else 'B' end
Keep in mind, the salesorder no. is correct for the SO I'm testing. So I would expect the expression to evaluate to 'A'. But when I use 'evalwf.php' on it, I get this query:
Code:
SELECT vtiger_salesorder.salesorderid FROM vtiger_salesorder INNER JOIN vtiger_crmentity ON vtiger_salesorder.salesorderid = vtiger_crmentity.crmid WHERE vtiger_crmentity.deleted=0 AND ( (( vtiger_salesorder.so_productionyear = '2018') and ( vtiger_salesorder.so_productionyear = 'B') )) AND vtiger_salesorder.salesorderid > 0
The second to last where clause should check for 'A', not 'B'. It's like every expression I write results in the 'else' clause. What am I doing wrong?

Hmm, it looks like the workflow is working when I test it. The eval script doesn't do a live check maybe?

By the way, I used a little trick to check the week, since 'smaller then' was not available:

I used the field 'so_productionyear' for comparison to check against (using 'is'). Then I used:
Code:
if so_productionweek < format_date(get_date('today'),'W') then so_productionyear else '1000' end
So basically, when then productionweek is in the past, I made productionyear check if it was itself, otherwise I returned something that will never be true ('1000').
Reply


Messages In This Thread
RE: Checking for a week number in a workflow expression - Guido1982 - 04-04-2018, 05:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)