var objRecord = record.load({                     ...
# suitescript
n
var objRecord = record.load({                     type: recType,                     id: RecID,                     isDynamic: true                   });                                    var objField = objRecord.getField({                      fieldId: field                  });                                    var options = objField.getSelectOptions({                      filter : '',                      operator : ''                  });
Copy code
return options
a
Why
getField
instead of
getValue
?
n
I am trying to return the entire list of options to place into a select field I have
@alien4u it works fine for say 'subsidiary' but I have a field 'custentity_xxxxx' that it returns null
a
Is that field a Multi-Select field or just a List Record field?
n
list/record field
a
Ok you need to get the list from the source... which mean if your field is a List/Record field using a Custom List you want to read/search the custom list to get all the possible options.
n
How would i do that?
a
I think it would be better to describe what do you want to do exactly? You are loading a record which already has a custom List/Record field which is sourcing its values/options from a custom list. Do you want to put those options/values into another field? in the same record? different record?
n
Basically I have a html form. It will gather the info to create a new customer record. But, I need to filter in all the select options for the mandatory fields. That is why I use an existing customer record to then get the select options from each field I need
a
My recommendation is to create a JSON/MAP with the fields you want/need, then do the proper search or searches to get the possible values/options for those fields.
n
like a custom list search? How would I get list options for a standard field vs custom?
a
Doing searches, you can search and get for example Subsidiaries(Names and IDs), Locations, Custom List, Custom Records.