Class NSTicketMessageEntity
The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).
Methods
GetAuthor()
A string representing the author of the message. Could be a user's name, or a persons email address.
Declaration
String GetAuthor() Examples
NSTicketMessageEntity thing;
String author = thing.GetAuthor();
Returns
| Type | Description |
| String |
GetBody()
The textbody for the message.
Declaration
String GetBody() Examples
NSTicketMessageEntity thing;
String body = thing.GetBody();
Returns
| Type | Description |
| String |
GetCreatedAt()
When the message was posted.
Declaration
DateTime GetCreatedAt() Examples
NSTicketMessageEntity thing;
DateTime createdAt = thing.GetCreatedAt();
Returns
| Type | Description |
| DateTime |
GetCreatedBy()
The associate who created this ticket message
Declaration
NSAssociate GetCreatedBy() Examples
NSTicketMessageEntity thing;
NSAssociate createdBy = thing.GetCreatedBy();
Returns
| Type | Description |
| NSAssociate |
GetCustomFields()
Gets the user-defined + extra fields on a TicketMessageEntity as a map.
Declaration
Map GetCustomFields() Examples
NSTicketMessageEntity thing;
Map fields = thing.GetCustomFields();
String oldValue = fields.get("SuperOffice:1");
fields.insert("SuperOffice:1", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
printLine(fields.getKey() + ": " + fields.getVal());
Returns
| Type | Description |
| Map |
GetDebugInfo()
The debug info for the message.
Declaration
String GetDebugInfo() Examples
NSTicketMessageEntity thing;
String debugInfo = thing.GetDebugInfo();
Returns
| Type | Description |
| String |
GetEjMessageId()
The primary key (auto-incremented)
Declaration
Integer GetEjMessageId() Examples
NSTicketMessageEntity thing;
Integer ejMessageId = thing.GetEjMessageId();
Returns
| Type | Description |
| Integer |
GetEmailHeader()
The email header is saved in this field as raw text
Declaration
String GetEmailHeader() Examples
NSTicketMessageEntity thing;
String emailHeader = thing.GetEmailHeader();
Returns
| Type | Description |
| String |
GetExtraFields()
Gets the extra fields on TicketMessageEntity as a map.
Declaration
Map GetExtraFields() Examples
NSTicketMessageEntity thing;
Map fields = thing.GetExtraFields();
String oldValue = fields.get("x_foobar");
fields.insert("x_foobar", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
printLine(fields.getKey() + ": " + fields.getVal());
Returns
| Type | Description |
| Map |
GetHtmlBody()
The HTML body for the message (if any).
Declaration
String GetHtmlBody() Examples
NSTicketMessageEntity thing;
String htmlBody = thing.GetHtmlBody();
Returns
| Type | Description |
| String |
GetImportant()
If this message is important or not.
Declaration
Bool GetImportant() Examples
NSTicketMessageEntity thing;
Bool important = thing.GetImportant();
Returns
| Type | Description |
| Bool |
GetMailSorter()
The name of the mail sorter used when the email was imported. Note: We must use name instead of id since the id's change every time one changes the mail sorter. :-0
Declaration
String GetMailSorter() Examples
NSTicketMessageEntity thing;
String mailSorter = thing.GetMailSorter();
Returns
| Type | Description |
| String |
GetMessageCategory()
Declaration
Integer GetMessageCategory() Examples
NSTicketMessageEntity thing;
Integer messageCategory = thing.GetMessageCategory();
Returns
| Type | Description |
| Integer | Defines what kind of message this is. See <xref href="CRMScript.NetServer.TicketMessageCategory" data-throw-if-not-resolved="false"></xref>. |
GetMessageHeaders()
Declaration
NSTicketMessageHeader[] GetMessageHeaders() Examples
NSTicketMessageEntity thing;
TicketMessageHeader[] messageHeaders = thing.GetMessageHeaders();
Returns
| Type | Description |
| NSTicketMessageHeader[] | Contains the message headers, like To, Cc, Bcc information, or custom headers. |
GetMessageId()
The X-Message-Id header value from the email. Used for threading, i.e. connecting messages to existing tickets.
Declaration
String GetMessageId() Examples
NSTicketMessageEntity thing;
String messageId = thing.GetMessageId();
Returns
| Type | Description |
| String |
GetPerson()
If this is an incoming message, this will contain the person
Declaration
NSPerson GetPerson() Examples
NSTicketMessageEntity thing;
NSPerson person = thing.GetPerson();
Returns
| Type | Description |
| NSPerson |
GetSearchTitle()
A copy of the title of the ticket, for search optimization and simpler reporting.
Declaration
String GetSearchTitle() Examples
NSTicketMessageEntity thing;
String searchTitle = thing.GetSearchTitle();
Returns
| Type | Description |
| String |
GetSlevel()
Declaration
Integer GetSlevel() Examples
NSTicketMessageEntity thing;
Integer slevel = thing.GetSlevel();
Returns
| Type | Description |
| Integer | The security level of the message. See <xref href="CRMScript.NetServer.TicketSecurityLevel" data-throw-if-not-resolved="false"></xref>. |
GetTicket()
The connected ticket
Declaration
NSTicket GetTicket() Examples
NSTicketMessageEntity thing;
NSTicket ticket = thing.GetTicket();
Returns
| Type | Description |
| NSTicket |
GetTimeSpent()
The time spent (minutes) for this message.
Declaration
Integer GetTimeSpent() Examples
NSTicketMessageEntity thing;
Integer timeSpent = thing.GetTimeSpent();
Returns
| Type | Description |
| Integer |
GetType()
Declaration
Integer GetType() Examples
NSTicketMessageEntity thing;
Integer type = thing.GetType();
Returns
| Type | Description |
| Integer | The type of the message (plaintext/html). See <xref href="CRMScript.NetServer.TicketMessageType" data-throw-if-not-resolved="false"></xref>. |
SetAuthor(String)
A string representing the author of the message. Could be a user's name, or a persons email address.
Declaration
Void SetAuthor(String author) Examples
NSTicketMessageEntity thing;
String author;
thing.SetAuthor(author);
Parameters
| Type | Name | Description |
| String | author |
Returns
| Type | Description |
| Void |
SetBody(String)
The textbody for the message.
Declaration
Void SetBody(String body) Examples
NSTicketMessageEntity thing;
String body;
thing.SetBody(body);
Parameters
| Type | Name | Description |
| String | body |
Returns
| Type | Description |
| Void |
SetCreatedAt(DateTime)
When the message was posted.
Declaration
Void SetCreatedAt(DateTime createdAt) Examples
NSTicketMessageEntity thing;
DateTime createdAt;
thing.SetCreatedAt(createdAt);
SetCreatedBy(NSAssociate)
The associate who created this ticket message
Declaration
Void SetCreatedBy(NSAssociate createdBy) Examples
NSTicketMessageEntity thing;
NSAssociate createdBy;
thing.SetCreatedBy(createdBy);
SetCustomFields(Map)
Sets the user-defined and extra fields on a TicketMessageEntity with a map.
Declaration
Void SetCustomFields(Map udefs) Examples
NSTicketMessageEntity thing;
Map udefs;
udefs["SuperOffice:1"] = "[I:123]";
udefs["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
udefs["custom.progid"] = "foobar";
udefs["x_foo"] = "foobar";
udefs["x_bar"] = "456"; // List item id
thing.SetCustomFields(udefs);
Parameters
| Type | Name | Description |
| Map | udefs |
Returns
| Type | Description |
| Void |
SetDebugInfo(String)
The debug info for the message.
Declaration
Void SetDebugInfo(String debugInfo) Examples
NSTicketMessageEntity thing;
String debugInfo;
thing.SetDebugInfo(debugInfo);
Parameters
| Type | Name | Description |
| String | debugInfo |
Returns
| Type | Description |
| Void |
SetEjMessageId(Integer)
The primary key (auto-incremented)
Declaration
Void SetEjMessageId(Integer ejMessageId) Examples
NSTicketMessageEntity thing;
Integer ejMessageId;
thing.SetEjMessageId(ejMessageId);
Parameters
| Type | Name | Description |
| Integer | ejMessageId |
Returns
| Type | Description |
| Void |
SetEmailHeader(String)
The email header is saved in this field as raw text
Declaration
Void SetEmailHeader(String emailHeader) Examples
NSTicketMessageEntity thing;
String emailHeader;
thing.SetEmailHeader(emailHeader);
Parameters
| Type | Name | Description |
| String | emailHeader |
Returns
| Type | Description |
| Void |
SetExtraFields(Map)
Sets the extra field values on TicketMessageEntity with a map.
Declaration
Void SetExtraFields(Map extras) Examples
NSTicketMessageEntity thing;
Map extras;
extras["SuperOffice:1"] = "[I:123]";
extras["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
extras["custom.progid"] = "foobar";
thing.SetExtraFields(extras);
Parameters
| Type | Name | Description |
| Map | extras |
Returns
| Type | Description |
| Void |
SetHtmlBody(String)
The HTML body for the message (if any).
Declaration
Void SetHtmlBody(String htmlBody) Examples
NSTicketMessageEntity thing;
String htmlBody;
thing.SetHtmlBody(htmlBody);
Parameters
| Type | Name | Description |
| String | htmlBody |
Returns
| Type | Description |
| Void |
SetImportant(Bool)
If this message is important or not.
Declaration
Void SetImportant(Bool important) Examples
NSTicketMessageEntity thing;
Bool important;
thing.SetImportant(important);
Parameters
| Type | Name | Description |
| Bool | important |
Returns
| Type | Description |
| Void |
SetMailSorter(String)
The name of the mail sorter used when the email was imported. Note: We must use name instead of id since the id's change every time one changes the mail sorter. :-0
Declaration
Void SetMailSorter(String mailSorter) Examples
NSTicketMessageEntity thing;
String mailSorter;
thing.SetMailSorter(mailSorter);
Parameters
| Type | Name | Description |
| String | mailSorter |
Returns
| Type | Description |
| Void |
SetMessageCategory(Integer)
Declaration
Void SetMessageCategory(Integer messageCategory) Examples
NSTicketMessageEntity thing;
Integer messageCategory;
thing.SetMessageCategory(messageCategory);
Parameters
| Type | Name | Description |
| Integer | messageCategory | Defines what kind of message this is. See <xref href="CRMScript.NetServer.TicketMessageCategory" data-throw-if-not-resolved="false"></xref>. |
SetMessageHeaders(NSTicketMessageHeader[])
Declaration
Void SetMessageHeaders(NSTicketMessageHeader[] messageHeaders) Examples
NSTicketMessageEntity thing;
NSTicketMessageHeader[] messageHeaders;
thing.SetMessageHeaders(messageHeaders);
Parameters
| Type | Name | Description |
| NSTicketMessageHeader[] | messageHeaders | Contains the message headers, like To, Cc, Bcc information, or custom headers. |
Returns
| Type | Description |
| Void |
SetMessageId(String)
The X-Message-Id header value from the email. Used for threading, i.e. connecting messages to existing tickets.
Declaration
Void SetMessageId(String messageId) Examples
NSTicketMessageEntity thing;
String messageId;
thing.SetMessageId(messageId);
Parameters
| Type | Name | Description |
| String | messageId |
Returns
| Type | Description |
| Void |
SetPerson(NSPerson)
If this is an incoming message, this will contain the person
Declaration
Void SetPerson(NSPerson person) Examples
NSTicketMessageEntity thing;
NSPerson person;
thing.SetPerson(person);
Parameters
| Type | Name | Description |
| NSPerson | person |
Returns
| Type | Description |
| Void |
SetSearchTitle(String)
A copy of the title of the ticket, for search optimisation and simpler reporting.
Declaration
Void SetSearchTitle(String searchTitle) Examples
NSTicketMessageEntity thing;
String searchTitle;
thing.SetSearchTitle(searchTitle);
Parameters
| Type | Name | Description |
| String | searchTitle |
Returns
| Type | Description |
| Void |
SetSlevel(Integer)
Declaration
Void SetSlevel(Integer slevel) Examples
NSTicketMessageEntity thing;
Integer slevel;
thing.SetSlevel(slevel);
Parameters
| Type | Name | Description |
| Integer | slevel | The security level of the message. See <xref href="CRMScript.NetServer.TicketSecurityLevel" data-throw-if-not-resolved="false"></xref>. |
Returns
| Type | Description |
| Void |
SetTicket(NSTicket)
The connected ticket
Declaration
Void SetTicket(NSTicket ticket) Examples
NSTicketMessageEntity thing;
NSTicket ticket;
thing.SetTicket(ticket);
Parameters
| Type | Name | Description |
| NSTicket | ticket |
Returns
| Type | Description |
| Void |
SetTimeSpent(Integer)
The time spent (minutes) for this message.
Declaration
Void SetTimeSpent(Integer timeSpent) Examples
NSTicketMessageEntity thing;
Integer timeSpent;
thing.SetTimeSpent(timeSpent);
Parameters
| Type | Name | Description |
| Integer | timeSpent |
Returns
| Type | Description |
| Void |
SetType(Integer)
Declaration
Void SetType(Integer type) Examples
NSTicketMessageEntity thing;
Integer type;
thing.SetType(type);
Parameters
| Type | Name | Description |
| Integer | type | The type of the message (plaintext/html). See <xref href="CRMScript.NetServer.TicketMessageType" data-throw-if-not-resolved="false"></xref>. |
Constructors
NSTicketMessageEntity()
Initializes a new instance of the NSTicketMessageEntity class.
Declaration
NSTicketMessageEntity