Event Subscriber Scripts as XML Definitions

Event Subscriber scripts let you run follow-up processing asynchronously after supported events occur.

Event Subscriber scripts are implemented as part of SuiteCloud projects created using the SuiteCloud Development Framework (SDF). In SDF, an Event Subscriber script is defined by an eventsubscriber SDF custom object.

For information about developing Event Subscriber scripts, see SuiteScript 2.1 Event Subscriber Script Type.

Take note of the following guidelines when creating the XML definition file for an Event Subscriber SDF object:

For information about the attributes and fields in an eventsubscriber SDF custom object, see eventsubscriber.

Example of an Event Subscriber Script Object

The following example defines an Event Subscriber object that references the eventSubscriber.js script file and subscribes to create events for sales order records.

The object definition XML file is named custevsub_salesorder.xml.

            <eventsubscriber scriptid="custevsub_salesorder">
  <scriptfilepath>[/SuiteScripts/eventSubscriber.js]</scriptfilepath>
  <criteria>
    <criterion>
      <domain>RECORD</domain>
      <type>CREATED</type>
      <parameters>
        <parameter>
          <name>RECORDTYPE</name>
          <operator>EQ</operator>
          <value>SALESORDER</value>
        </parameter>
      </parameters>
    </criterion>
  </criteria>
</eventsubscriber> 

          

Related Topics

General Notices