Field Object Members in SuiteScript 2.1 Documentation

Understand the Field Object Members in SuiteScript 2.1 for effective document extraction in NetSuite.

·2 min read·View Oracle Docs

Field Object Members are crucial for developers using SuiteScript in NetSuite, specifically for document processing. They allow for efficient manipulation of field data extracted from uploaded documents. The following members are key components of the Field Object:

Member TypeNameReturn Type / Value TypeSupported Script TypesDescription
PropertyField.labeldocumentCapture.FieldLabelServer scriptsThe label (name) of the field.
PropertyField.typestringServer scriptsThe type of the field.
PropertyField.valuedocumentCapture.FieldValueServer scriptsThe value of the field.

Important Usage Notes

  • The Field.label, Field.type, and Field.value members provide essential data for mapping processed document fields during runtime.
  • These properties are read-only, and attempting to set their values will result in a READ_ONLY error code.

Syntax Example

The following is a simplified code example demonstrating how to use these members in a SuiteScript:

suitescript
1// Sample script demonstrating Field Object access
2const extractedData = documentCapture.documentToStructure({
3 file: file.load("SuiteScripts/sample_invoice.pdf"),
4 documentType: documentCapture.DocumentType.INVOICE,
5 features: [documentCapture.Feature.FIELD_EXTRACTION]
6});
7const fieldLabel = extractedData.pages[0].fields[0].label;

Who This Affects

  • Developers: Gaining insights into field extraction during programming.
  • Administrators: Understanding field configurations in document processing.

Key Takeaways

  • Field Object Members are integral for extracting data from documents in SuiteScript 2.1.
  • Properties like Field.label, Field.type, and Field.value are read-only and specific to server scripts.
  • Effective usage of the field object enhances document processing efficiency.

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

Frequently Asked Questions (4)

Can Field Object Members be used in client scripts in SuiteScript 2.1?
No, Field Object Members like `Field.label`, `Field.type`, and `Field.value` are only supported in server scripts.
What happens if I try to modify a property of Field Object Members?
Attempting to modify properties like `Field.label`, `Field.type`, or `Field.value` will result in a `READ_ONLY` error code, as they are read-only properties.
Do Field Object Members support all types of fields in document processing?
Field Object Members specifically handle field data extracted from documents processed in SuiteScript, with properties such as `Field.label`, `Field.type`, and `Field.value` available for mapping these fields.
Is there a prerequisite for loading a document in SuiteScript for field extraction?
Yes, documents need to be loaded using the `file.load` method, and processed with `documentCapture.documentToStructure` for field extraction in SuiteScript 2.1.
Source: Field Object Members 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 Integration

View all Integration articles →