Jebathon
Jebathon

Reputation: 4561

SuiteScript 2.0 - Load Custom Record Table Data

Within Customization -> List, Records & Fields -> Custom Records I have a table with id: customrecord_{name} with the type "customrecordtype". I have multiple fields in that record

enter image description here

How can I use the load function to get all the data for this table/record? (For all the fields)

const data= record.load({
                type: 'customrecord_{name}',
                isDynamic: false
                ... //get all fields
});

I tried to look at the help center but am a bit lost on how to accomplish this.

Upvotes: 0

Views: 650

Answers (1)

hergin
hergin

Reputation: 36

As far as I know load won't do it. After loading a custom record with load, you can check all the fields of this custom record by calling data.getFields() method. This will return a list of field ids (including custom ones) that you can fetch by calling data.getValue such as data.getValue({'fieldId':'isinactive'}) // a regular field or data.getValue({'fieldId':'custrecord_routeproduce_highpriority'}) // a custom field

loading a custom record, checking its fields, fetching value of a custom field

Upvotes: 2

Related Questions