Page 1 of 1

Automate Action + MySQL Query = Database Error 1054

Posted: 12 Oct 2020, 07:42
by empmdk
I have an automate actions button for voiding invoices. I've created a Function to pull the SUM of assigned users in a "Tasks" sub entity. A MySQL Query was created to pull the value of the function. This is to check if a user has been assigned to any tasks under the parent.
In the automate actions filters, I choose the MySQL Query field for that function and have it set to include 0. The purpose is to not show the void button if a user is assigned to any tasks. If there are no assigned users, have it show the button to allow voiding.

When I add the filter mentioned above, it will cause a database error on the parents item page.
Database Error: 1054 - Unknown column 'field_848' in 'having clause'
Query: select e.id from app_entity_48 e where e.id=10 having ((field_848=0))
Page: /index.php?module=items/info&path=48-10

Re: Automate Action + MySQL Query = Database Error 1054

Posted: 06 Nov 2020, 07:26
by support
Can't reproduce it. Please provide screenshot with error and more detailed instruction how to reproduce.

Re: Automate Action + MySQL Query = Database Error 1054

Posted: 03 Jun 2021, 07:03
by empmdk
Has been a while since I've tested this. Still getting same error after a couple updates.
I've attached images of the record page with & without the automate action filtering the MySQL query, as well as the configuration for the other related items.
  • Automate Actions button to void invoice. Filter to exclude status (complete & void) and another filter for the "Assigned Users Check" field to include 0
  • Assigned Users Check - MySQL Formula field pulls # of assigned users from SUM function. The function is looking for field 832 (Services sub-entity Users field).
  • List of records query is only used to have a list of all users assigned to sub-entity services.
When then Automate Actions filter for the "Assigned Users Check" field is configured to include 0 or <1, the page loads with the error. Error occurs with & without a user assigned to a sub-entity service.