getOrderField()

The getOrderField() function (client-side) retrieves the value of body fields belonging to the transaction page from which users open the product. The transaction must be available for NetSuite CPQ Configurator. For more information about compatible transactions, see Selecting Eligible Transactions.

Syntax

Use these syntax formats for the getOrderField() function.

  • To retrieve a single field:

                    getOrderField('fieldId'); 
    
                  
  • To retrieve multiple fields:

                    getOrderField(['fieldId1', 'fieldId2', 'fieldIdn']); 
    
                  

Return Value

The getOrderField() function returns either a string with the field internal ID or an array of strings with the field internal IDs.

Parameters

As a required parameter, the getOrderField() function accepts either a string with the field ID or an array of strings with the field IDs you want to retrieve.

Results for dropdown lists, multi-select fields, and image fields return the internal ID of the selected option or image. To get the selected option label or the image relative URL in the File Cabinet, add the :text suffix to the field ID. For example, 'location:text' will give you the location's name, such as San Francisco.

To retrieve the field label, add the :label suffix to the field ID. For example, 'location:label' returns Location.

Examples

The following examples show how to use the getOrderField() function.

Retrieving the Internal ID or the Label of a Transaction Field

This example obtains the internal ID of the Customer field (field ID: entity).

              getOrderField('entity'); 

            

See the output:

              1387 

            

Using the :label suffix, you can retrieve the field label.

              getOrderField('entity:label'); 

            

See the output:

              Customer 

            

Related Topics

General Notices