Document Object Members for SuiteScript 2.1 Machine Translation
Document Object Members enable efficient management of documents for SuiteScript 2.1's machine translation.
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 to include features of the Loop Returns integration in NetSuite Connector 2026.1. Loop Returns Integration in NetSuite Connector 2026.1
- Create Integration Records for OAuth 2.0 in NetSuite 2026.1
In NetSuite 2026.1, administrators can create integration records for applications to use OAuth 2.0, enabling secure access. Here's how.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category