Is there any simple way to return a suiteQL query ...
# suitescript
d
Is there any simple way to return a suiteQL query from a map/reduce getInputData without having to iterate through data?
s
IIRC, you can return an object like
{ suiteql: 'query'}
t
@tdietrich that example looks like it's running the query manually which is what I thought @Dominic B wanted to avoid?
If you scroll down, the suiteanswer I linked above has an MR example - my memory wasn't quite right on the format but indeed you can just return a plain object reference to a SuiteQL query from
getInputData()
from their example:
Copy code
return {
            type: 'suiteql',
            query: suiteQL,
            params: [271]
        };
where their query string is in the
suiteQL
variable.
d
Thanks both. @stalbert that's exactly what I was after. I thought there was probably a method, but it's not documented in the main getInputData help file.
👍 1
s
Like many things NetSuite, I have no explanation as to why that's not part of the main
getInputData
documentation.
d
you can also feed
getInputData
a reference to a saved
query.Query
object (analytics workbook). See below and NS Help: getInputData(inputContext)
Copy code
return {
    type: 'query',
    id: 'custworkbook237'
}
111 Views