SDF Custom Objects in SuiteApps Example

The following sdfinstallationscript object is as an XML definition that is kept in the Objects folder of the project. It defines the SuiteCloud Development Framework (SDF) installation record and the deployment for the migrate.js SDF installation script that migrates accounts with SuiteApp 4.0 to SuiteApp 4.1.

In the custscript1 field definition, the customlist_transaction_field record type is selected, which is a custom list holding the following values: val_a, val_b, val_c. The script deployment definition specifies val_a for the custscript1 script field (also known as a script parameter).

          <sdfinstallationscript scriptid="customscript_install_script">
  <description>This is my example sdf installation script</description>
  <isinactive>F</isinactive>
  <name>Install Script Demo</name>
  <notifyadmins>F</notifyadmins>
  <notifyemails></notifyemails>
  <notifyowner>T</notifyowner>
  <notifyuser>F</notifyuser>
  <scriptfile>[/SuiteApps/com.example/migrate.js]</scriptfile>
  <scriptcustomfields>
    <scriptcustomfield scriptid="custscript1">
      <accesslevel>2</accesslevel>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <displaytype>NORMAL</displaytype>
      <fieldtype>SELECT</fieldtype>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <label>test</label>
      <onparentdelete>NO_ACTION</onparentdelete>
      <searchlevel>2</searchlevel>
      <selectrecordtype>[scriptid=customlist_transaction_field]</selectrecordtype>
      <storevalue>T</storevalue>
    </scriptcustomfield>
  </scriptcustomfields>
  <scriptdeployments>
    <scriptdeployment scriptid="customdeploy1">
      <custscript1>[scriptid=customlist_transaction_field.val_a]</custscript1>
      <isdeployed>T</isdeployed>
      <loglevel>ERROR</loglevel>
      <status>RELEASED</status>
      <title>Demo Deployment</title>
    </scriptdeployment>
  </scriptdeployments>
</sdfinstallationscript> 

        

The following XML definition is a custom transaction type which the new field is created on. The name of the transaction type is “My Vendor Payment” and this object is contained in v4.0 of the SuiteApp. The transaction body field is new for the upgraded SuiteApp (version 4.1) that the SDF installation script is verifying is installed to the target account.

          <customtransactiontype scriptid="customtransaction_install_script">
    <name>My Vendor Payment</name>
    <subliststyle>BASIC</subliststyle</name>
</customtransactiontype> 

        

The following XML definition is a list record containing values that can be set on the "My New Field" custom transaction body field, on the "My Vendor Payment" custom transaction.

          <customlist scriptid="customlist_transaction_field">
    <isinactive>F</isinactive>
    <isordered>T</isordered>
    <name>test script param </name>
    <customvalues>
        <customvalue scriptid="val_a">
            <isinactive>F<isinactive>
            <value>A</value>
        </customvalue>
        <customvalue scriptid="val_b">
            <isinactive>F<isinactive>
            <value>B</value>
        </customvalue>
        <customvalue scriptid="val_c">
            <isinactive>F<isinactive>
            <value>C</value>
        </customvalue>
    </customvalues>
</customlist> 

        

The following XML definition is the new transaction body field that is part of the v4.1 SuiteApp. The “My New Field” field can be set to values defined in the “customlist_transaction_field” object and it appears on the Custom subtab of the My Vendor Payment.

          <transactionbodycustomfield scriptid="custbody_install_script">
    <accesslevel>2</accesslevel>
    <displaytype>NORMAL</displaytype>
    <fieldtype>SELECT<fieldtype>
    <label>My New Field</label>
    <storevalue>T</storevalue>
    <selectrecordtype>[scriptid=customlist_transaction_field]</selectrecordtype>
    <bodycustomtransactions>[scriptid=customtransaction_install_script]</bodycustomtransactions>
</transactionbodycustomfield> 

        

Related Topics

SDF Installation Script Example of Customizing a SuiteApp Update
SDF Installation SuiteScript File Example
Deploy File that Executes the SDF Installation Script Example

General Notices