Shot in the dark here, but has anyone ever experie...
# suiteql
d
Shot in the dark here, but has anyone ever experienced
runSuiteQLPaged
returning duplicate records? Changing the
pageSize
causes the duplicate rows to go away, but this seems like a fragile solution without knowing the root cause.
Copy code
SELECT
            txn.id as id,
        FROM transaction AS txn
        JOIN transactionline txn_line
        ON (txn_line.transaction = txn.id)
        JOIN transactionaccountingline as txn_acc_line
        ON (
          txn_acc_line.transactionline = txn_line.id
          and txn_acc_line.transaction = txn.id
          )
        JOIN account
        ON (txn_acc_line.account = account.id)
    WHERE
      txn.trandate >= TO_DATE('2022-01-01', 'YYYY-MM-DD')
      and txn.trandate <= TO_DATE('2024-05-01', 'YYYY-MM-DD')
      and account.accttype = 'CredCard'
      and MOD(txn.id, 2) = 0
Here's the query that's returning duplicates for what it's worth
s
Try adding an
ORDER BY txn.id
and see if it helps. Best practice is to paginate by the last result, e.g. if the last ID was 12345, you'd add
WHERE txn.id > 12345 ORDER BY txn.id
to get the next page.
s
we have seen duplicate bugs in standard N/search runPaged() and recently switched to using getRange() and paging manually to work around the problem.