loopMessage

loopMessage class

Tip: Samples available on GitHub. For more information, see loopMessage samples.

Initiates DocGen Package requests to run asynchronously.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

global class loopMessage

The loopMessage class exposes the following members.

Constructors

Member name Description
loopMessage Creates an instance of the class for use with the sendAllRequests method.

Methods

Member name Description
loopMessage.send method Submit a single DocGen Package request.
loopMessage.sendAllRequests method Submits a group of DocGen Package requests.

Properties

Member name Description
loopMessage.batchNotification property Gets or sets the batch notification type when using the sendAllRequests method.
loopMessage.instance property Gets or sets the Salesforce instance of the current organization, if instructed by Nintex support.
loopMessage.requests property Gets or sets a new loopMessageRequest instance.
loopMessage.sessionId property Gets or sets the Salesforce session ID, if needed.
loopMessage.usePreview property Gets or sets a DocGen Package preview environment, if available.
loopMessage.loopUrl property Gets or sets the Nintex environment, if needed.

Enumerations

Class name Description
Notification enumeration Specifies notification only of errors in the batch run.

Inner classes

Class name Description
loopMessage.requests property Create a collection of DocGen Package requests to run as a batch.

Remarks

The loopMessage object initiates DocGen Package runs from Apex asynchronously. Use the static send methods to send a single DocGen Package request, or use the instance sendAllRequests method along with the requests property to send one or more DocGen Package requests at once.

loopMessage constructor

Creates an instance of the loopMessage object for use with the sendAllRequests method.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

loopMessage()

Remarks

The loopMessage constructor is for use with the sendAllRequests method for sending one or more DocGen Package requests at once.

loopMessage methods

The loopMessage class exposes the following members.

Methods

Member name Description
loopMessage.send method Submit a single DocGen Package request.
loopMessage.sendAllRequests method Submits a group of DocGen Package requests.

loopMessage.sendAllRequests method

Submits a group of DocGen Package requests.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

String sendAllRequests()

Return Value

Type: String

This method returns a string corresponding to the body of the response for the DocGen Package request.

Remarks

When you're done adding to the requests property and have set up all other properties on your loopMessage object, use this method to send/submit all of the DocGen Package requests.

loopMessage.send method

Submits a single DocGen Package request.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Overload List

Name Description
loopMessage.send(String, String, String) method Passes the variables for the DocGen Package request as a URL encoded string.
loopMessage.send(String, String, String, String) method Passes the variables for the DocGen Package request as a URL encoded string and sets the Salesforce instance.
loopMessage.send(String, String, Map<String, String>) method Passes the variables for the DocGen Package request as a map of strings.
loopMessage.send(String, String, Map<String, String>, String) method

Passes the variables for the DocGen Package request as a map of strings and sets the Salesforce instance.

loopMessage properties

The loopMessage class exposes the following members.

Properties

Member name Description
loopMessage.batchNotification property Gets or sets the batch notification type when using the sendAllRequests method.
loopMessage.instance property Gets or sets the Salesforce instance of the current organization, if instructed by Nintex support.
loopMessage.requests property Gets or sets the collection of loopMessageReqeust objects assigned to the loopMessage object.
loopMessage.sessionId property Gets or sets the Salesforce session ID, if needed.
loopMessage.usePreview property Gets or sets a DocGen Package preview environment, if available.

loopMessage.batchNotification property

Gets or sets the batch notification type when using the sendAllRequests method.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

Loop.loopMessage.Notification batchNotification

Property Value

Type: Notification enumeration

Sets one of the values from the Notification enumeration.

Remarks

The running user can be notified at the beginning and end of the batch run, at the end only, only if there are errors in the batch run, or not at all.

loopMessage.instance property

Gets or sets the Salesforce instance of the current organization, if instructed by Nintex support.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

String instance

Property Value

Type: String

The Salesforce instance. For example, na5 or cs10.

Remarks

Specifies the Salesforce instance of the current organization. Should only be used when instructed by Nintex support. This is mostly used for sites with custom URLs.

Example

Example description

loopMessage.instance = 'na5';

loopMessage.requests property

Gets or sets the collection of loopMessageRequest objects assigned to the loopMessage object.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

List<loopMessageRequest> requests

Property Value

Type: List<loopMessage.requests property>

One or more loopMessageRequest objects.

Remarks

To send multiple DocGen Package requests by invoking the sendAllRequests method of the loopMessage object, create a new loopMessageRequest object for each DocGen Package request and assign it to this collection.

Example

The following example illustrates how to add a loopMessage type instance to loopMessageRequest type.

loopMessage.requests.add(new loopMessageRequest( ... ));

Note: Portions of this code snippet have been replaced with ellipses for readability purposes. It won't run "as is."

loopMessage.sessionId property

Gets or sets the Salesforce session ID, if needed.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

String sessionId

Property Value

Type: String

This is the session ID.

Remarks

Set the value of this property to a Salesforce session ID only when the current context does not provide a value for the getSessionId method of the UserInfo object. For example, you must set the value of this property when working with future methods, batch Apex jobs, or scheduled Apex jobs.

Example

The following example illustrates how to specify the Salesforce session ID for a loopMessage object.

void myMethod(string sessionId) {
...
Loop.loopMessage lm = new Loop.loopMessage();
lm.sessionId = sessionId;
...
}

Note: Portions of this code snippet have been replaced with ellipses for readability purposes. It won't run "as is."

loopMessage.usePreview property

Gets or sets a DocGen Package preview environment, if available.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

Boolean userPreview

Property Value

Type: Boolean

If no preview environment is available, this property is ignored.

Remarks

Before a new release, Nintex makes a DocGen Package preview environment available for testing backwards compatibility. Use this property to run DocGen Packages in the preview environment.

 

loopMessage.loopUrl property

Gets or sets the Nintex environment, if needed.

Namespace: LOOP

Package: Nintex DocGen for Salesforce

Signature

static String loopUrl 

Property Value

Type: String

Remarks

Statically specifies the Nintex environment used by loopMessage. Should only be used when instructed by Nintex support.

Example

Example description

loopMessage.loopUrl = 'na1';