MessageData Object Members
Explore MessageData object members in SuiteScript 2.1, including methods and properties essential for handling messages.
The MessageData object in SuiteScript 2.1 provides various members essential for manipulating message data effectively. This object includes both properties and methods that facilitate access to detailed message characteristics and operations.
What Are the Members of the MessageData Object?
The MessageData object comprises the following members:
| Name | Type | Supported Script Types | Description |
|---|---|---|---|
| MessageData.filename | string | Server scripts | The name of a file. |
| MessageData.date | Date | Server scripts | The date of a message or modification date of the file. |
| MessageData.format | pgp.Format | Server scripts | Literal data packet type. |
| [MessageData.getText()] | string | Server scripts | Extracts the contents of a message as text. |
| [MessageData.toMessage()] | pgp.Message | Server scripts | Creates a message with no signature, compression, or encryption. |
| [MessageData.encrypt(options)] | pgp.Message | Server scripts | Creates a message that is encrypted and optionally signed. |
Property Details
MessageData.filename
- Type:
string - Description: The name of the file associated with the message.
- Error Handling: Attempting to set this property will trigger a
READ_ONLY_PROPERTYerror.
MessageData.date
- Type:
Date - Description: Represents the date of the message or the file's modification date.
- Error Handling: Attempting to set this property will also result in a
READ_ONLY_PROPERTYerror.
Key Methods of MessageData
MessageData.getText()
This method retrieves the complete text contained within the message.
MessageData.toMessage()
This method creates a fresh message object without any signatures, compression, or encryption—ideal for raw message handling.
MessageData.encrypt(options)
Generates an encrypted message, with the option to include a signature. This method enhances the security of the transmitted messages.
Conclusion
The MessageData object members are invaluable for developers working with message handling in SuiteScript 2.1, providing vital functionalities for managing encrypted messages and associated file data.
Who This Affects
- Administrators: Responsible for managing and configuring script use within their environment.
- Developers: Utilizing SuiteScript 2.1 for enhancing applications and features tied to message handling.
Key Takeaways
- The MessageData object plays a crucial role in managing message-related data in SuiteScript 2.1.
- Key properties include
filenameanddate, both of which are read-only. - Several methods facilitate text extraction and encryption of messages, enhancing data security.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
What script types are supported by the MessageData object members?
Can you modify properties like filename or date in the MessageData object?
How does the MessageData.encrypt(options) method enhance message security?
Are there any methods in the MessageData object for handling message contents as text?
Was this article helpful?
More in Platform
- Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- In This Help Topic
Explore N/log module guidelines, log levels, and script execution logs for efficient logging in SuiteScript.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category