Azi
08/08/2022, 5:41 PMAlan Fitch
08/08/2022, 5:49 PMquery.runSuiteQL(theQuery).asMappedResults(x => {return {...x, fieldname: x.fieldname == "T"}})
Azi
08/08/2022, 6:09 PMAzi
08/08/2022, 6:10 PMAlan Fitch
08/08/2022, 6:15 PMCASE WHEN fieldname = 'T' THEN 1 ELSE 0 END
then your if(x.fieldname)
would work in js.Azi
08/08/2022, 6:15 PMscottvonduhn
08/08/2022, 6:16 PMAzi
08/08/2022, 6:17 PMAlan Fitch
08/08/2022, 6:17 PMscottvonduhn
08/08/2022, 6:17 PMgenerally 0, the empty string ‘’ or null all evaluate as falsy in JavaScript, so you can use that to your advantage.
scottvonduhn
08/08/2022, 6:19 PMAzi
08/08/2022, 6:24 PMquery.runSuiteQL(theQuery).asMappedResults(x => {return {...x, fieldname: x.fieldname == "T"}})
This doesn't work.
I assume you meant this?
query.runSuiteQL(theQuery).asMappedResults().map(x => {return {...x, fieldname: x.fieldname == "T"}})
Alan Fitch
08/08/2022, 6:25 PMAlan Fitch
08/08/2022, 6:25 PMAzi
08/08/2022, 6:26 PMPavol
08/11/2022, 1:27 PMBUILTIN_RESULT.TYPE_BOOLEAN()
Azi
08/12/2022, 4:23 PM