error in suite ql when attempting to pull value fr...
# ask-stanley-ai
n
error in suite ql when attempting to pull value from multiple select field: JOIN employee e ON LOCATE(',' || e.id || ',', ',' || v.custentity_aw_automate_vendor_approver || ',') > 0
c
AI generated answer (using internal Slack threads):
Based on the conversations provided, here are the answers to the questions: 1. For the issue with the SuiteQL query, the problem seems to be with the UNION operation. The solution provided was to wrap each SELECT statement in parentheses and then select from that result set. Here is the corrected query:
Copy code
sql
SELECT t.* FROM ((SELECT id, firstname, lastname, email, isinactive FROM vendor WHERE isperson = 'T') UNION (SELECT id, firstname, lastname, email, isinactive FROM employee)) t
2. For the issue with using a multiple select field in a workflow action, it is indeed possible but not straightforward. The solution provided involves using a custom formula to compare a multiselect field to the contents of a single value field. Here are the formulas for server-side and client-side respectively:
Copy code
sql
TO_CHAR(INSTR({multiselect field}||',',{comparison field}||','))
Copy code
javascript
(nlapiLookupField('customer',nvl(nullIfEmpty(nlapiGetFieldValue('entity')),-1),'custentity_po_free_ship_methods',false).concat(',')).indexOf(nlapiGetFieldValue('shipmethod').concat(','))>=0
Please note that in the JavaScript comparison, if the value is not present, the comparison value is equal to -1, and if it is present, it is greater than or equal to zero. 3. For the issue with the CASE statement, the problem seems to be the missing END statement. The corrected formula should look like this:
Copy code
sql
CASE WHEN {custcol1} = 'C02757' THEN Replace(ns_concat({item.custitem_mm_specifcation}), ',' , '<br>') END
Please ensure that the column is set to max-grouping. ****** 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.810319364
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806456089
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806366
Please provide your feedback on this answer.