InvokePerform
→ stringExecutes a SOAP Perform action on a fully configured SOAP API object. Use with CreateObject and SetObjectProperty to start, pause, or stop objects such as automations and triggered send definitions.
Available in:
Email
CloudPage
Automation
Triggered Send
Syntax
Platform.Function.InvokePerform(apiObject, action[, statusMessage, errorCode])
2–4 arguments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apiObject |
object | Yes | SOAP object built with CreateObject and configured with SetObjectProperty |
action |
string | Yes | Action to perform (e.g. "start", "pause", "stop") |
statusMessage |
string | No | Variable (passed by reference) that receives the status message |
errorCode |
string | No | Variable (passed by reference) that receives the error code |
Examples
var sendDef = Platform.Function.CreateObject("TriggeredSendDefinition");
Platform.Function.SetObjectProperty(sendDef, "CustomerKey", "WelcomeEmail_TSD");
var status = "";
var code = "";
var result = Platform.Function.InvokePerform(sendDef, "start", status, code);
if (code !== "0") {
Write("Error " + code + ": " + status);
} else {
Write("Triggered send definition started.");
}
WSProxy is recommended over InvokePerform for most use cases — it is simpler, uses native JS objects, and handles serialization automatically.