why am i getting error 'unsupported search' with t...
# ask-stanley-ai
n
why am i getting error 'unsupported search' with this query: WITH EmployeesWithRole AS ( SELECT e.id AS employee_id FROM Employee e INNER JOIN EmployeeRolesForSearch ERS ON ERS.Entity = e.ID INNER JOIN Role r ON r.ID = ERS.Role WHERE r.ID = 1035 -- Selects employees assigned to Role 1035 ) SELECT sn.recordid AS vendor_id, sn.field AS changed_field, sn.oldvalue AS previous_address, sn.newvalue AS updated_address, sn.date AS change_timestamp, ewr.employee_id FROM SystemNote sn JOIN Vendor v ON v.id = sn.recordid CROSS JOIN EmployeesWithRole ewr -- Ensures all employees assigned to Role 1035 are included WHERE sn.recordtypeid = 'Vendor' AND sn.field = 'Address' AND v.id = '91863' ORDER BY sn.date DESC;
c
AI generated answer (using internal Slack threads):
The error 'unsupported search' usually occurs when you are trying to use a function or a feature that is not supported by SuiteQL. In the first conversation, the user was trying to use a UNION operation in their query. The error was resolved when they wrapped the UNION operation in a subquery. In the second conversation, the user was trying to use the LISTAGG function, which is not supported in SuiteQL. The community suggested using a different tool or summarizing the detail rows in script logic. In the third conversation, the user was trying to compare a timestamp to a string, which is not supported. The community suggested wrapping the string in a TO_DATE() function to cast it to a Date type. In your case, the error might be due to the use of JOIN operations in your subquery. JOIN operations are not supported in subqueries in SuiteQL. You might need to refactor your query to avoid using JOIN operations in subqueries. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829280376
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824127
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823093355
Please provide your feedback on this answer.