Document Object Members for SuiteScript 2.1 Machine Translation
Document Object Members enable document management for SuiteScript 2.1 machine translation. TL;DR Opening Document Object Members are integral to the
TL;DR Opening
Document Object Members are integral to the SuiteScript 2.1 machine translation module, allowing developers to manage documents effectively for translation tasks. This includes handling document IDs, languages, and text content that can be translated.
Overview of Document Object Members
The Document Object in SuiteScript 2.1 includes several key members, each serving a specific function in managing document data. The main members are as follows:
| Member Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
Document.id | string | Server scripts | The ID of the document. |
Document.language | string | Server scripts | The language of the document. |
Document.text | string | Server scripts | The content of the document. |
Member Details
Document.id
The Document.id property stores a unique identifier for the document. It's essential that all document IDs passed to the machineTranslation.translate(options) function are unique to ensure proper processing.
Document.language
This property denotes the language in which the document is written. If this property is left null, the translation service will automatically detect the document's source language. Additionally, when receiving translated documents, this property indicates the target language into which the document contents have been translated.
Document.text
Document.text holds the actual text content of the document, which is to be translated.
Error Handling
Both Document.id and Document.language properties are read-only. Attempting to set these properties will result in a READ_ONLY error code.
Example Syntax
Here is a syntactical representation of how to utilize these members. Note that this example is not functional as a complete script; it serves only to demonstrate syntax usage:
1const myDocument = machineTranslation.createDocument({2 id: 'myDoc',3 text: 'This is a document to be translated.'4});5 6const translationResults = machineTranslation.translate({7 documents: [myDocument],8 targetLanguage: machineTranslation.Language.CZECH9});10 11const docId = translationResults.results[0].id;Who This Affects
- Developers: They can implement document translation features using the properties detailed above.
- Administrators: Administrators may need to configure permissions and settings associated with document management in machine translation.
Key Takeaways
- Document members in SuiteScript 2.1 facilitate efficient document handling for machine translation.
- Each document requires a unique ID for the translation process.
Document.languageandDocument.textare pivotal for successful translation workflow.
Frequently Asked Questions (4)
Which script types support the use of Document Object Members in SuiteScript 2.1?
Can I change the value of Document.id or Document.language in SuiteScript 2.1?
What happens if the Document.language property is set to null?
How should Document.id be handled when managing multiple documents for translation?
Was this article helpful?
More in Integration
- Loop Returns Integration in NetSuite Connector 2026.1
Updated for NetSuite Connector 2026.2, introducing Salesforce Connector enhancements and Loop Returns integration.
- Concurrency Governance Limits in NetSuite SuiteCloud
Concurrency governance limits are determined by NetSuite service tiers and SuiteCloud Plus licenses, impacting integration performance.
- MCP Standard Tools SuiteApp for Record Management in NetSuite
Enhance record management, report generation, and data analysis with the MCP Standard Tools SuiteApp in NetSuite.
- NetSuite HTTPS Request Parameters for SuiteScript 2.x
Learn key HTTPS request parameters in NetSuite SuiteScript 2.x for effective external service integration.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category