Structure of a Subrecord

The fields available in a subrecord vary depending on the subrecord’s type. A subrecord can have body fields, a sublist, or both.

When working with a subrecord’s fields, be aware of the following:

For examples of subrecords that are structured in different ways, see the following sections:

Writable Body Fields Example

The address subrecord has several writable body fields, such as city, state, and zip. It has no sublist.

Writable body fields highlighted.

After you instantiate an address subrecord, you can set values for its body fields with the Record.setValue(options) method, the same as if you were setting values on an instance of a record. For more details, see Creating an Address Sublist Subrecord Example and Creating an Address on a Subsidiary Record Example.

Writable Sublist Example

The landed cost subrecord has a sublist that lets you list individual expenses associated with merchandise you have received. The body fields on this subrecord are read-only, but the sublist is writable. To add details about an expense, you add a line to the sublist.

An example of a writable sublist.

After you instantiate a landed cost subrecord, you can set values for its sublist fields with the same methods you would to set values on a record’s sublist: setSublistValue() and setCurrentSublistValue().

For more details, see Creating a Landed Cost Sublist Subrecord Example.

Writable Body Fields and Sublist Example

The order schedule subrecord has a sublist that lets you configure how and when upcoming purchase orders are to be created. This subrecord has body fields that let you specify various qualities of the schedule, such as whether individual purchase orders must be created manually. It also has a sublist that lets you enter dates for the upcoming purchase orders.

An example of writable body fields and writable sublist fields highlighted.

Again, after you instantiate an order schedule subrecord, you can set values on its fields with the same methods you would use to set values on a record. For body fields, use setValue(). For sublist fields, use setCurrentSublistValue() or setSublistValue().

For more details, see Creating an Order Schedule Sublist Subrecord Example.

Related Topics

About Subrecords
Supported Deployments for Subrecord Scripting
Body Field Subrecords and Sublist Subrecords
Finding Subrecord Details in the Records Browser
About the Address Subrecord

General Notices