Automate Action + MySQL Query = Database Error 1054

Post Reply
empmdk
Posts: 170
Joined: 21 Nov 2016, 05:56
Name: Brandon Ramey

Automate Action + MySQL Query = Database Error 1054

Post 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
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Automate Action + MySQL Query = Database Error 1054

Post by support »

Can't reproduce it. Please provide screenshot with error and more detailed instruction how to reproduce.
empmdk
Posts: 170
Joined: 21 Nov 2016, 05:56
Name: Brandon Ramey

Re: Automate Action + MySQL Query = Database Error 1054

Post 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.
Attachments
Assigned-Users_SQL-Formula.png
Record-Page_Unfiltered.png
Record-Page_Filtered-Error.png
List-of-Records-Query-Field.png
Automate-Action_Flowchart.png
Automate-Action_Filters.png
Automate-Action_Filters.png (7.19 KiB) Viewed 1429 times
Post Reply