I have a restlet that returns a transaction search...
# suitescript
s
I have a restlet that returns a transaction search as JSON to a calling program. The search summarizes data and returns 4 columns. The script includes column "labels"... columns: [ SEARCHMODULE.createColumn({ name: "parent", join: "customer", summary: "GROUP", sort: SEARCHMODULE.Sort.ASC, label: "Customer" }), SEARCHMODULE.createColumn({ name: "transactionnumber", summary: "COUNT", label: "Num Orders" }), SEARCHMODULE.createColumn({ name: "type", summary: "GROUP", label: "Type" }), SEARCHMODULE.createColumn({ name: "amount", summary: "SUM", sort: SEARCHMODULE.Sort.DESC, label: "Total Amt" }) ] ...but those are being ignored and the JSON is being returned with... "values": {                 "GROUP(customer.parent)": [                     {                         "value": "4840138",                         "text": "Customer ABC"                     }                 ],                 "COUNT(transactionnumber)": "5",                 "GROUP(type)": [                     {                         "value": "SalesOrd",                         "text": "Sales Order"                     }                 ],                 "SUM(amount)": "123.45"             } ...how do I get my JSON return to have the labels as the column names instead of summary functions? Will I have to manually rename them in script?
b
manually do it
s
return Seq(LazySearch.from(mysearch)).map(nsSearchResult2obj()).toArray()