Custom Plug-in Object Examples

The following two examples are provided for custom plug-ins in SuiteCloud Development Framework (SDF):

Custom Plug-in Type Object Example

The following is an XML definition example of a custom plug-in type object in SuiteCloud Development Framework (SDF).

The object defines the custom plug-in type customscript_doc_signing that has the user-friendly name Document Signing. The object has a default implementation of the plug-in specified in documentSign.js using the methods getSignature and addApproval. Alternate implementations of those methods can be specified in a custom plug-in implementation object.

            <plugintype scriptid="customscript_doc_signing">
    <deploymentmodel>ALLOW_MULTIPLE</deploymentmodel>
    <loglevel>DEBUG</loglevel>
    <name>Document Signing</name>
    <scriptfile>[/SuiteScripts/documentSign.js]</scriptfile>
    <status>RELEASED</status>
    <methods>
      <method>
        <method>getSignature</method>
        <description>Gets the signature for the document.</description>
      </method>
      <method>
        <method>addApproval</method>
        <description>Adds the approval for the document.</description>
      </method>
    </methods>
</plugintype> 

          

Custom Plug-in Implementation Object Example

The following is an XML definition example of a custom plug-in implementation object in SDF.

The object defines an alternate implementation of the customscript_doc_signing custom plug-in type. The alternate implementation is customscript_doc_signing_implementation with a user-friendly name of Alternate Document Signing. The alternate implementation is defined in altDocumentSign.js.

            <pluginimplementation scriptid="customscript_doc_signing_implementation">
    <customplugintype>[scriptid=customscript_doc_signing]</customplugintype>
    <isinactive>F</isinactive>
    <loglevel>DEBUG</loglevel>
    <name>Alternate Document Signing</name>
    <notifyadmins>F</notifyadmins>
    <notifyowner>T</notifyowner>
    <notifyuser>F</notifyuser>
    <scriptfile>[/SuiteScripts/altDocumentSign.js]</scriptfile>
    <status>RELEASED</status>
</pluginimplementation> 

          

Related Topics

Custom Plug-ins as XML Definitions
Creating a Custom Plug-in in an XML Definition
Instantiating a Custom Plug-in Script in an XML Definition
Validating a Custom Plug-in in an XML Definition

General Notices