In a suitelet POST request I know i can get sublis...
# suitescript
n
In a suitelet POST request I know i can get sublist data by using
Copy code
request.getSublistValue({ group: 'sublistName', line: i, name: 'custpage_fieldname' });
But is there a way to dynamically get all the column names from the sublist? Currently i'm using
Copy code
request.parameters.custpage_listfields.split('\u0001')
Which works, but feels messy. Didn't know if there was a better way
b
I usually define them in a constant. Then use that constant to create the columns and access them wherever else.
👍 1
n
I thought about doing that too. I'm populating the sublist based on a provided saved search, so i guess when i get the search i could just set the field names there. Thanks!
b
True. You could get the columns from the search again in POST.
n
That's a good idea too. I kind of backed myself into a corner trying to make this suitelet as dynamic as possible, so that i could reuse the code with a config file to build a suitelet to do whatever you want.
b
The more dynamic the better! Love doing that. (Side note: Hey Nathan 👋)
n
Lol hey blob wave Currently messaging Perla about seeing you in the wild
b
I'll be at SuiteWorld this year!
n
Oh hell yeah! We definitely need to meet up there. Would be great to meet you in person.
blob 100 2
p
👀 Hey you two! Yall are both awesome. 🙂
🎉 1
😊 1