is there a limit of a string length of a query res...
# suitescript
m
is there a limit of a string length of a query result? seems to cut after 249 characters?
n
Not sure about that but are you seeing this in the execution logs or checking it in code? Reason I ask is the execution logs will definitely truncate and I think it's about that figure.
m
no, it is in an e-mail I sent.. the body got truncated and when I check the length of the string it is only 249 chars
l
m
might be, but I run a N/query in a map reduce script and no report..
w
What does the SQL-string look like for that particular field? Running a N/query doesn't seem to limit the result to 249 chars.
message has been deleted
s
I've noticed my query results seems to always cap at 250 characters.
w
var strSQL = 'SELECT length(to_char(CUSTOMRECORD_TEMP.custrecord_data)) as alengthoflongtext, CUSTOMRECORD_TEMP.custrecord_data AS custrecorddataRAW FROM CUSTOMRECORD_TEMP';
var objPagedData = query.runSuiteQLPaged({
query: strSQL,
pageSize: 50
});
var arrResults = [];
arrResults.push.apply(arrResults,objPagedData.fetch({index:0}).data.asMappedResults());
This gave me the full value of a long text-field
👍 1
I noticed that If I load a pre-existing workbook, it contains substring() and convert_ambig_clob_to_html(). The latter has a parameter value of 250.
s
Oh I bet this is the joined filter problem, @Mattias Uppström are there formulas or joins in your criteria?
m
no
w
From the workbook:
convert_ambig_clob_to_html(substr(CUSTOMRECORD_TEMP.custrecord_data, 1, 500), 250, '')
What I replaced it with:
CUSTOMRECORD_TEMP.custrecord_data AS custrecorddataRAW
m
so work around seems to be suiteql?
s
I'm not sure, can you try retrieving that data via regular query Tomas.
w
@Sandii, not sure what you mean by "regular query"?
s
like
Copy code
query.create();
query.columns = [];
query.run()
Yeah I just created/ran a simple query with no filters, and field data is capped at 250 using above.
m
worked great with suiteql @Watz, thank you!
should be a defect?
w
🤷‍♂️
s
Sounds kinda like a defect unless there is some unknown parameter you can pass somewhere to run unrestricted or something when building with normal query module API's.
w
@Sandii running toSuiteQL() on the normal query shows that it adds the extra formulas. for the CLOB-field
s
Yeah i do see that, wonder if there is a way around it
👍 1
w
Yes there is. If you create the column as a formula with to_char({longtextfield}) it will pull the full value
newQuery.createColumn({
formula: 'to_char({longtextfield})',
type: query.ReturnType.STRING,
alias: 'datafield'
})