MessageData Object Members

Explore MessageData object members in SuiteScript 2.1, including methods and properties essential for handling messages.

·2 min read·View Oracle Docs

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:

NameTypeSupported Script TypesDescription
MessageData.filenamestringServer scriptsThe name of a file.
MessageData.dateDateServer scriptsThe date of a message or modification date of the file.
MessageData.formatpgp.FormatServer scriptsLiteral data packet type.
[MessageData.getText()]stringServer scriptsExtracts the contents of a message as text.
[MessageData.toMessage()]pgp.MessageServer scriptsCreates a message with no signature, compression, or encryption.
[MessageData.encrypt(options)]pgp.MessageServer scriptsCreates 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_PROPERTY error.

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_PROPERTY error.

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 filename and date, 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?
The MessageData object members are supported in server scripts.
Can you modify properties like filename or date in the MessageData object?
No, attempting to set the 'filename' or 'date' properties will result in a 'READ_ONLY_PROPERTY' error as they are read-only.
How does the MessageData.encrypt(options) method enhance message security?
The MessageData.encrypt(options) method generates an encrypted message and can include a signature, which securely enhances the transmitted messages.
Are there any methods in the MessageData object for handling message contents as text?
Yes, the MessageData.getText() method is used to retrieve the complete text contained within a message.
Source: MessageData 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 Platform

View all Platform articles →