Hi, can anyone help me out? I want to get the fiel...
# suitescript
a
Hi, can anyone help me out? I want to get the field IDs of all the fields present on a Purchase Order (PO). I’m using
recordObj.getFields()
, but it only returns the IDs of fields that contain values. How can I retrieve all field IDs, including empty ones?
a
are you sure? are you sure its just not returning them in an order that is unexpected so your "missing" fields are actually somewhere else?
image.png
image.png
a
Thanks for your response!** I noticed that
getFields()
only returns fields that contain data. When I add a value to a field, it appears in the results, but if I remove the value, the field disappears again. This behavior is similar to the NetSuite Field Explorer extension, which only displays fields with values. However, I found an alternative approach: extracting the XML of the record, which includes all field IDs—even empty ones.
a
okay but I literally do exactly that in the console above and you're incorrect, because the class field had no value but there it is in the getFields response
a
Thanks. Can you try with any custom fields instead of class field. I need one more help, line fields are not getting disabled. I used currentRecord.getSublistField()
a
i don't need to try I know what the getFields method does.. I was just giving you evidence
sorry, I'm not sure what you're asking
line fields are not getting disabled. I used currentRecord.getSublistField()
you're trying to disable sublist fields? I wanna say you could do that in SS1.0 but they never implemented in 2.0 presumably you're doing this conditionally in some client script?
a
Thanks. Actually the client wants to disable all the fields on PO, body as well as line except 5 to 6 body field.
a
probably just want a different form with the restrictions at the form level then... and default that form based on role, and don't allow those roles to change form types