ERROR in cron job with condition from [current_user_id]
Posted: 11 Jan 2020, 14:17
Hi Sergey,
using Version 2.5.2, I set up a new MySQL formula field to dertermine
1. the state (chosen option) from a dropmenu and
2. whether the current user is assigned to the task
The formula is:
CASE
WHEN get_value([902])>=4 THEN
IF ([1074]=(SELECT [current_user_id]),1,0)
ELSE 0
END
I have also tried to use [current_user_id] without the SELECT but it does not work either.
In the table listing the field shows correct values in the entier table .... everything fine.
The problem occurs when using the values from the MySQL Formula field in an autoatic status field.
I have used values from from MySQL formula field at different applications in Automatic Status fields and they always work okay. Therefore, the problem must be linked to the [current_user_id] variable.
The cron job delivers a long message, the key lines at the beginning are:
<app_db_error>
<div style="color: #b94a48; background: #f2dede; border: 1px solid #eed3d7; padding: 5px; margin: 5px; font-family: verdana; font-size: 12px; line-height: 1.5;">
<div><strong>Database Error:</strong> 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '),1,0)
ELSE 0
END) as field_1311 from app_entity_63 e where e.id>0 having ((f' at line 12411</div>
<div><strong>Query:</strong> select e.* , ((select fcv.value from app_fields_choices fcv where fcv.id = .........
The problem about seems to be right at the position where I use the [current_user_id] variable.
Thank you for looking into this issue.
Best, Pepe
using Version 2.5.2, I set up a new MySQL formula field to dertermine
1. the state (chosen option) from a dropmenu and
2. whether the current user is assigned to the task
The formula is:
CASE
WHEN get_value([902])>=4 THEN
IF ([1074]=(SELECT [current_user_id]),1,0)
ELSE 0
END
I have also tried to use [current_user_id] without the SELECT but it does not work either.
In the table listing the field shows correct values in the entier table .... everything fine.
The problem occurs when using the values from the MySQL Formula field in an autoatic status field.
I have used values from from MySQL formula field at different applications in Automatic Status fields and they always work okay. Therefore, the problem must be linked to the [current_user_id] variable.
The cron job delivers a long message, the key lines at the beginning are:
<app_db_error>
<div style="color: #b94a48; background: #f2dede; border: 1px solid #eed3d7; padding: 5px; margin: 5px; font-family: verdana; font-size: 12px; line-height: 1.5;">
<div><strong>Database Error:</strong> 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '),1,0)
ELSE 0
END) as field_1311 from app_entity_63 e where e.id>0 having ((f' at line 12411</div>
<div><strong>Query:</strong> select e.* , ((select fcv.value from app_fields_choices fcv where fcv.id = .........
The problem about seems to be right at the position where I use the [current_user_id] variable.
Thank you for looking into this issue.
Best, Pepe