I have the below query loaded from a dataset. whic...
# suiteql
h
I have the below query loaded from a dataset. which gives correct result in the UI (under Analytics) but the same query if i try to run in the browser console by using N/query it throws the below error
Search error occurred: Element does not exist or element class SqlPredicate is expected. Node class: gudusoft.gsqlparser.nodes.TExpression Node type: 30
"SELECT
"TRANSACTION".trandate AS trandateRAW /*{trandate#RAW}*/,
"TRANSACTION".memo AS memoRAW /*{memo#RAW}*/,
"TRANSACTION".entity AS entityRAW /*{entity#RAW}*/,
"TRANSACTION".tranid AS tranidRAW /*{tranid#RAW}*/,
"TRANSACTION".trandisplayname AS trandisplaynameRAW /*{trandisplayname#RAW}*/,
"TRANSACTION"."TYPE" AS typeRAW /*{type#RAW}*/,
"TRANSACTION".foreigntotal AS foreigntotalRAW /*{foreigntotal#RAW}*/,
BUILTIN.CURRENCY("TRANSACTION".foreigntotal) AS foreigntotalRAW_C /*{foreigntotal#RAW}*/
FROM
"TRANSACTION"
WHERE
UPPER("TRANSACTION"."TYPE") IN ('CUSTOM101')
AND BUILTIN.MNFILTER("TRANSACTION".custbody_bm_period_range, 'MN_INCLUDE_EXACTLY', '', 'FALSE', '20', '21')
"
Just for clarity, here i am trying to find the records which exactly matches multi-select field values '20' and '21' can someone please help if you have already known about this error Thanks!
m
@Hrusikesh Behera that
BUILTIN.MNFILTER
seems to be an undocumented helper for querying multiselect fields. There should be a "map" table that you can use as an explicit join instead. Have a look at this thread for an example: https://netsuiteprofessionals.slack.com/archives/C01FBBZ8PQC/p1611270372003100
h
Thanks for the comment @michoel I will look at it.