Given that record.getFields() says this: `The orde...
# suitescript
j
Given that record.getFields() says this:
The order of the custom fields returned by this method on a custom record does not respect the configuration of the custom record fields page in the UI.
, does anyone know a way to get the fields on a custom record IN THE ORDER they are on that record (even if possibily they were created in a different order)?
a
you mean the form?
j
no, literally just how the order they are listed on the custom record itself
a
uhh... I have no idea... why would any one want the fields in that completely arbitrary order?
to be clear you mean this listing?
... the order is editable
j
I know they are editable. It’s not arbitrary…. for us
I’m embedded temporary fields in another page, based on the order they appear here.
hard to explain why
a
i remember it
ok so you can load the custom record type
and the custom fields are a sublist, and you can just loop thru it
j
yeah I can get all the fields, they just come out in teh wrong order
a
on the customfield sublist? they're not in order?
j
not a sublist, just doing record.load then getFields to get them all
might not be child record, still deciding that
a
right I'm talking about loading the type of
customrecordtype
not an instance of your custom record
j
two custom records here. Record A (normal record, but in UI will show set of fields from Record B)
there’s no sublist tho
a
the record that gets return is the same as the record that i took a screen shot of above... the sublist customfields is the Fields sublist
j
there’s no sublist involved
I’m not explaining well
I’m in an arbitrary UE. I want to get fields from some totally unrelated custom record, in the order that they are in that custom record.
a
i think you are, I just think you're not understand me... i'll DM you
r
Just do what he did in the browser console. And replace 1219 with your custom record id. The record ID not the individual record in it. @Anthony OConnor this was something new for me, you were spot on.
a
honestly new to me too 😉 but jen always has these fun problems that make think... "is this possible?" 😄
😂 4
j
Gonna try this in the a.m. and report back 🙂
IT WORKED
A bit fiddly, as I had to actually combine my method and that of @Anthony OConnor (who is my new favourite person, btw). His method to get the fields in the right ORDER, mine to get the field labels.
🫶 1
🥳 1
🙌 1
😂 1
a
nice, congrats