Custom Record Instances

In SuiteCloud Development Framework (SDF), custom record instances are defined in the custom record type object. Instances of custom records, including the custom record object, can be either imported into a SuiteCloud project or downloaded from a NetSuite account. For more information, see Downloading the XML Definition of an Object from a NetSuite Account.

Custom record instances are grouped within the instances structure. In this structure, each instance is recorded in its own instance structure. An instance contains standard elements, such as name and isinactive, but also contains custom elements that are named after the script IDs of the custom fields in the custom record. For more information about instance elements, see instance.

Each instance has a parent element that you can use when the hierarchical element of the custom record type object is set to T.

The following example shows a single instance that was imported from a NetSuite account. The custom record contains two custom fields:

          <customrecordtype scriptid="customrecord_sample">
    ...
    <hierarchical>T</hierarchical>
    ...
    <customrecordcustomfields>
        <customrecordcustomfield scriptid="custrecord_employeename">
            ...
            <label>My Favorite Employee</label>
            <fieldtype>SELECT</fieldtype>
            <selectrecordtype>-4</selectrecordtype>
            ...
        </customrecordcustomfield>
        <customrecordcustomfield scriptid="custrecord_sampletextfield">
            ...
            <label>Sample Text Field</label>
            <fieldtype>TEXT</fieldtype>
            ...
        </customrecordcustomfield>
    </customrecordcustomfields>
    ...
     <instances>
        <instance scriptid="_this_instance">
            <custrecord_employeename>[ACCOUNT_SPECIFIC_VALUE]</custrecord_employeename>
            <custrecord_sampletextfield>Here is some sample text.</custrecord_sampletextfield>
            <name>My first instance of a custom record.</name>
            <isinactive>F</isinactive>
        </instance>
        <instance scriptid="_that_instance">
            <custrecord_employeename>[ACCOUNT_SPECIFIC_VALUE]</custrecord_employeename>
            <custrecord_sampletextfield>Here is some more sample text.</custrecord_sampletextfield>
            <name>My second instance of a custom record.</name>
            <isinactive>F</isinactive>
            <parent>[scriptid=customrecord_sample._this_instance]</parent>
        </instance>
     </instances>
    ...
</customrecordtype> 

        

For more information about account-specific values, see Account-Specific Values Validation in SuiteCloud Projects.

Custom Record Instances of Custom Segment Values

When a custom segment is applied to a custom record type, the segment field can be specified on each custom record instance. This field cannot be configured in the customrecordcustomfield subrecord structure of the custom record object, but its value can be specified in the custom record instance.

The following is an example of a custom record type instance that references a custom segment instance. The example assumes that the custom segment has a script ID of cseg_segmentid, and the segment is applied to the customrecord_sample custom record type. Additionally, the associated custom record type, customrecord_cseg_segmentid, should contain an instance with a script ID of some_customsegment_instance_id.

            <customrecordtype scriptid="customrecord_sample">
    ...
    <instances>
        <instance scriptid="_value1">
            <isinactive>F</isinactive>
            <name>My first instance</name>
            <cseg_segmentid>[scriptid=customrecord_cseg_segmentid.some_customsegment_instance_id]</cseg_segmentid>
        </instance>
    </instances>
    ...
</customrecordtype> 

          

For more information about custom segment objects, their associated custom record type objects, and their instances, see Custom Segments as XML Definitions.

Related Topics

General Notices