I'm getting the following error `"SSS_SEARCH_ERROR...
# suiteql
m
I'm getting the following error
"SSS_SEARCH_ERROR_OCCURRED","message":"Search error occurred: Invalid or unsupported search"
. What's really strange is that if I add an additional filter such as
AND field NOT IN ('XXXXXX')
it works!? Anyone seen this before? Full query in thread
Copy code
SELECT
   transaction.id AS id,
   transaction.tranid AS document_number,
   transaction.recordtype AS type,
   customrecord_nsts_ci_gen_ci_links.custrecord_nsts_cil_ci_number AS ci_number,
   transaction.trandate AS date,
   transaction.duedate AS due_date,
   transaction.entity AS bill_to_id,
   BUILTIN.DF(transaction.entity) AS bill_to,
   customer.custentity_cs_customer_cc AS bill_to_acc,
   customer.custentity_cs_payer_number AS bill_to_ledger_number,
   transactionAccountingLine.amount AS amount,
   ROUND(transaction.foreignamountunpaid * 1 * transaction.exchangerate, 2) AS amount_remaining,
   transaction.currency AS currency_id,
   transaction.exchangerate AS exchange_rate 
FROM
   transaction 
   JOIN
      transactionline 
      ON transaction.id = transactionline.transaction 
      AND transactionLine.mainline = 'T' 
   JOIN
      transactionAccountingLine 
      ON transactionAccountingLine.transactionline = transactionLine.id 
      AND transactionAccountingLine.transaction = transactionLine.transaction 
   JOIN
      customer 
      ON transaction.entity = customer.id 
   LEFT OUTER JOIN
      customrecord_nsts_ci_gen_ci_links 
      ON transaction.custbody_nsts_ci_link = customrecord_nsts_ci_gen_ci_links.id 
WHERE
   transaction.recordtype = 'invoice' 
   AND transaction.foreignamountunpaid > 0 
   AND transactionline.subsidiary = 3 
   AND NVL(transaction.duedate, transaction.trandate) <= TO_DATE('2021-6-12', 'YYYY-MM-DD') 
   AND customer.custentity_cs_payer_number NOT IN ('XXX')  -- if this line is removed search returns error: Search error occurred: Invalid or unsupported search
   AND ROUND(transaction.foreignamountunpaid * transaction.exchangerate, 2) < 20
ORDER BY
   transaction.duedate ASC,
   transaction.trandate ASC
t
@michoel I've seen this a number of times now, especially when querying the Transaction table, and also when querying the Entity table as well. I have a somewhat bizarre theory as to why this happens, and I'll try to write it up sometime. I'm curious... If you comment out everything in the SELECT clause, except for " transaction.id" and then also comment out "AND customer.custentity_cs_payer_number NOT IN ('XXX')" as well, does the query work? If so, try adding things back into the SELECT clause and see what causes the query to fail.
m
Thanks, @tdietrich. With just
SELECT transaction.id AS
the query just times out (XHR Error: Status 504). Looking forward to hearing your theory behind this when you get a chance to publish it.
t
@michoel Out of curiosity, does this work?
Copy code
SELECT
   transaction.id AS id,
   transaction.tranid AS document_number
FROM
   transaction 
   JOIN
      transactionline 
      ON transaction.id = transactionline.transaction 
      AND transactionLine.mainline = 'T' 
   JOIN
      transactionAccountingLine 
      ON transactionAccountingLine.transactionline = transactionLine.id 
      AND transactionAccountingLine.transaction = transactionLine.transaction 
WHERE
   transaction.recordtype = 'invoice' 
   AND transaction.foreignamountunpaid > 0 
   AND transactionline.subsidiary = 3 
   AND NVL(transaction.duedate, transaction.trandate) <= TO_DATE('2021-6-12', 'YYYY-MM-DD') 
   AND ROUND(transaction.foreignamountunpaid * transaction.exchangerate, 2) < 20
ORDER BY
   transaction.duedate ASC,
   transaction.trandate ASC
m
@tdietrich yup that works
r
Was this for the purposes of generating an A/R Aging? If so, how did you work in net credits as with Credit Memos and other credits to the customer A/R balance?
m
@rickthewilliams no, this is used in a customization that automates writing off of bad debts / small short payments
👍 1