Custom Transaction Form Field Examples
The following sections provide XML examples for custom transactionForm
SDF custom object fields in SuiteCloud Development Framework (SDF):
Email Message Template Field
The Email Message Template field is defined by emailMessageTemplate
in the XML definition. It specifies which transaction email template to use for the transaction type, when sending transaction emails with a PDF attachment.
The following is an XML definition example of an emailMessageTemplate
field that references an email message template with the scripid c ustemailtmpl_sales
.
<transactionForm scriptid="custform_sales1" standard="STANDARDSALESORDER">
<name>Sales Order 1</name>
<recordType>SALESORDER</recordType>
...
<emailMessageTemplate>[scriptid=custemailtmpl_sales]</emailMessageTemplate>
...
</transactionForm>
Never Empty Field
The Never Empty field is defined by neverEmpty
in the XML definition. It specifies that at least one row must be entered for the sublist by the user when neverEmpty
is set to T.
The following is an XML definition example of a neverEmpty
field that is set to true:
<transactionForm scriptid="custform_sales1" standard="STANDARDSALESORDER">
<name>Sales Order 1</name>
<recordType>SALESORDER</recordType>
<inactive>F</inactive>
<preferred>T</preferred>
<mainFields>
....
</mainFields>
<tabs>
<tab>
<id>TRANSACTIONITEMS</id>
<label>Items</label>
<visible>T</visible>
<fieldGroups>
<defaultFieldGroup>
<fields position="MIDDLE">
...
</fields>
</defaultFieldGroup>
</fieldGroups>
<subItems>
<subList>
<id>ITEM</id>
<neverEmpty>T</neverEmpty>
<columns>
...
</columns>
</subList>
</subItems>
</tab>
...
</transactionForm>
In the preceding example, the neverEmpty
is set to T for the ITEM sublist, meaning that the sublist must have a value set by the user entering data into the form.
Roles Field
The Roles field is defined by roles in the XML definition. It specifies the custom transaction form as the preferred form for specific roles. For each role field specified in the transactionForm
SDF custom object, the corresponding id field value must be for a role that has sufficient permissions for the transaction form.
The following is an XML definition example of a roles field that defines two roles:
<transactionForm scriptid="custform_sales1" standard="STANDARDSALESORDER">
<name>Sales Order 1</name>
<recordType>SALESORDER</recordType>
...
<roles>
<role>
<id>[scriptid=CUSTOMROLE_1013]</id>
<preferred>false</preferred>
</role>
<role>
<id>WAREHOUSE_MANAGER</id>
<preferred>false</preferred>
</role>
</roles>
...
</transactionForm>
In the preceding example, the custform_sales1
form is the preferred custom transaction form for the WAREHOUSE_MANAGER
role and the custom role referenced by the scriptid
CUSTOMROLE_1013
when performing a SALESORDER
transaction.
Space Before Field
The Space Before field is defined by spaceBefore
in the XML definition. It specifies to include a blank line before a field when spaceBefore
is set to an integer value.
The following is an XML definition example of spaceBefore
set to 1 for the CUSTOMFORM
field:
<transactionForm scriptid="custform_demo" standard="STANDARDSALESORDER">
<name>Sales Order 1</name>
<recordType>SALESORDER</recordType>
<inactive>F</inactive>
<preferred>T</preferred>
<mainFields>
<fieldGroup scriptid="primaryinformation">
<label>Primary Information</label>
<visible>T</visible>
<showTitle>T</showTitle>
<singleColumn>F</singleColumn>
<fields position="MIDDLE">
<field>
<id>CUSTOMFORM</id>
<label>Custom Form</label>
<visible>T</visible>
<mandatory>T</mandatory>
<displayType>NORMAL</displayType>
<columnBreak>F</columnBreak>
<spaceBefore>1</spaceBefore>
<sameRowAsPrevious>F</sameRowAsPrevious>
</field>
...
</fields>
</fieldGroup>
</mainFields>
...
</transactionForm>
Total Box Field
The Total Box field is defined by totalBox
in the XML definition. It specifies the fields that you want to show in the form totals.
The following is an XML definition example of a totalBox
field:
<transactionForm scriptid="custform_sales1" standard="STANDARDSALESORDER">
<name>Sales Order 1</name>
<recordType>SALESORDER</recordType>
...
<totalBox>
<totalBoxField>
<id>TOTAL</id>
<label>Total</label>
<visible>T</visible>
</totalBoxField>
<totalBoxField>
<id>SUBTOTAL</id>
<label>Subtotal</label>
<visible>T</visible>
</totalBoxField>
</totalBox>
...
</transactionForm>
Related Topics
- Transaction Forms as XML Definitions
- Supported Custom Transaction Form Objects
- Adding Custom Transaction Forms to Your SuiteCloud Project
- Custom Transaction Form Use Cases
- Custom Transaction Form Format
- Custom Transaction Form Validation
- Limitations for Custom Transaction Forms
- Linking Custom Transaction Forms
- Custom Transaction Form Example