Trying to use the debugger to create a CSV file fr...
# suitescript
s
Trying to use the debugger to create a CSV file from n/query. Any tips on how to do that? When I use .asMap() or .asMappedResults() I get duplicate alias error because I’m referencing both line and header memo fields among others.
c
You could either nest loops, iterating over the outside loop when the header identifier changes and the inner loop when the other fields change, or break the query down into two or more to get a differently shaped dataset
s
I was able to get it. any suggestions on how to deal with DataSet pulling internal ids vs. names? I’m designing the dataset in NetSuite UI. do you suggest that i create the query in Script?
c
I'm only used to writing SuiteQL in script -- I know in that case, I either need to explicitly join the table in that contains the name or use
BUILTIN.DF(entity)
to get the name as opposed to the internal id. I know there's a convenience method you can update your query definitions with that will do the same -- lemme see if I can rustle it up...
Well, I don't remember where I ran across it ¯\_(ツ)_/¯