SuiteScript getCurrentSublistValue Method Reference

The SuiteScript getCurrentSublistValue method retrieves values from sublist fields, enhancing script functionality in records.

·2 min read·View Oracle Docs

The getCurrentSublistValue method in SuiteScript allows scripts to retrieve the value of a specified sublist field from the currently selected line in a sublist. This is crucial in dynamic scripting, where UI behaviors replicate the current selection in NetSuite.

Method Description

The method is designed to return different data types based on the field being accessed. It can handle:

  • number
  • Date
  • string
  • array
  • boolean

Supported Script Types

  • Client scripts
  • Server scripts

Governance

  • None

Module

  • N/record Module

Parameters

The following table outlines the required parameters when using the method:

ParameterTypeRequired/OptionalDescription
options.sublistIdstringRequiredThe internal ID of the sublist, viewable in the Records Browser.
options.fieldIdstringRequiredThe internal ID of a standard or custom sublist field.

Errors

Common error codes associated with getCurrentSublistValue include:

  • SSS_INVALID_SUBLIST_OPERATION: Thrown if a required argument is invalid or if the sublist is not editable.
  • SSS_MISSING_REQD_ARGUMENT: Thrown if a required argument is missing or undefined.

Syntax

Here is the syntax for using the method, with a sample implementation:

suitescript
1// Add additional code
2...
3var sublistValue = objRecord.getCurrentSublistValue({
4 sublistId: 'item',
5 fieldId: 'item'
6});
7...
8// Add additional code

Related Topics

Key Takeaways

  • The getCurrentSublistValue method is essential for retrieving sublist field values in SuiteScript.
  • It requires specific parameters, including sublistId and fieldId.
  • Proper use can enhance script efficiency and accuracy in dynamic mode implementations.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

What script types support the use of the getCurrentSublistValue method in SuiteScript?
The getCurrentSublistValue method is supported in both client scripts and server scripts.
Do I need to worry about governance units when using the getCurrentSublistValue method?
No, the getCurrentSublistValue method does not consume any governance units.
What parameters are required when using the getCurrentSublistValue method?
The method requires two parameters: 'sublistId', the internal ID of the sublist, and 'fieldId', the internal ID of the sublist field.
What error might I encounter if the sublist is not set up correctly when using getCurrentSublistValue?
You might encounter the 'SSS_INVALID_SUBLIST_OPERATION' error if a required argument is invalid or if the sublist is not editable.
Source: Syntax Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Platform

View all Platform articles →