Field Object Members in SuiteScript 2.1 Documentation
Understand the Field Object Members in SuiteScript 2.1 for effective document extraction in NetSuite.
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 Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Property | Field.label | documentCapture.FieldLabel | Server scripts | The label (name) of the field. |
| Property | Field.type | string | Server scripts | The type of the field. |
| Property | Field.value | documentCapture.FieldValue | Server scripts | The value of the field. |
Important Usage Notes
- The
Field.label,Field.type, andField.valuemembers 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_ONLYerror code.
Syntax Example
The following is a simplified code example demonstrating how to use these members in a SuiteScript:
1// Sample script demonstrating Field Object access2const 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, andField.valueare read-only and specific to server scripts. - Effective usage of the field object enhances document processing efficiency.
Frequently Asked Questions (4)
Can Field Object Members be used in client scripts in SuiteScript 2.1?
What happens if I try to modify a property of Field Object Members?
Do Field Object Members support all types of fields in document processing?
Is there a prerequisite for loading a document in SuiteScript for field extraction?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
