Hey Everyone , Is there any way to create a search...
# suitescript
h
Hey Everyone , Is there any way to create a search using N/search module in which we don't have to name each columns of a custom record type in the column property of the search.create() function and it just returns the records with all of the columns?
n
I don't believe so. You could load a record and do getFields on the record object to ascertain the field values to use as columns...
h
But still I have to enter manually the field id of each column : (
n
"manually" use the array of values from getFields...
c
@NElliott Someone on here recently ran into a limitation of
getFields()
when it comes to a record with no value in certain fields - https://netsuiteprofessionals.slack.com/archives/C29HQS63G/p1695665922308869
n
Yes, in a User Event on the newRecord object....
c
Correct, I'm bringing it up here as hopefully helpful context for Hannan's exploration
n
Kinda goofy if you're in a UE and creating a search for the record you're actually on, but sure 🤭
🤡 1
m
@Hannan Ashraf I think you'd be better served doing this with SuiteQL. You can do something like: SELECT * FROM CustomRecord WHERE CustomRecord.id = 15 Then you can do .asMappedResults() to get the data back as a JSON object.