Custom Transaction Types in Workflows

If appropriate, you can reference your custom transaction types when you create workflows. For details, see the following sections:

Referencing Status in a Workflow Action

For certain types of workflow actions, you may want to reference the status of a custom transaction type. In these cases, you can identify the status by using the Parameters section of the Workflow Action page. To reference the status field, set the Field value to Custom Transaction Status.

Parameters section of Workflow Action page.

If you are using the Set Field Value action, you can choose the Static Value radio button and select the status from the Selection list. The list shows all of the available custom transaction statuses, listed according to custom transaction type. Select the appropriate combination of transaction type and status.

Sample workflow action showing combination of transaction type and status.

Using Status as a Workflow Condition

If appropriate, you can use a custom transaction type’s status as a workflow condition. On the Workflow Condition page, set Record Type to Transaction and Field to Status. (Note that this approach is different from the way you reference status in a workflow action. With that form, you set Status to Custom Transaction Status.) In the Selection field, choose the appropriate combination of transaction type and status.

Sample Workflow Condition page where a custom transaction type is used as a workflow condition.

Sales Custom Transaction Transform Action Workflow Example

Sales and purchase custom transaction types are available in the Transform Action in workflows, so you can add custom buttons to custom transaction pages.

You may want to create a custom transaction from an existing transaction type instance, or you may want to create a transaction instance from a custom transaction. You can use workflows to specify transformations with custom transactions. Use standard workflow functionality to specify when the button appears.

For example, on your Invoice page, you want to display a custom button that is available in View mode. When the user clicks the button, a new instance of the custom transaction opens, with the Customer, Date, Period, Subsidiary, Class, Department, Location, and Items fields prefilled. The user verifies the information and clicks Save.

You can also add a custom button to the custom transaction page, for example, a Pro-forma Invoice. When the user clicks the button, a new instance of the standard transaction opens, with the Customer, Date, Period, Subsidiary, Class, Department, Location, and Items fields prefilled. The user verifies the information and clicks Save.

Payment links and generic transformation links are used to transform custom transactions. A Transformation type link is created only if a Payment type link does not already exist. For example, transforming a Custom Sales Transaction to a standard Customer Payment record creates a payment link, but not a transformation link.

The Transformation type link creates a link between transformed transactions in custom transactions when you save the custom transaction. A transformation link is created whenever an instance of a custom transaction is the source or destination of a transformation. The link appears on target transaction in the Created From field and at the source transaction in Related Records.

Example:

We want to add a button to a sales custom transaction type for payment. Our example triggers the workflow on create, view, or update of a Sample Sales Transaction record.

Sample sales transaction workflow.

The first state occurs before the record loads to add a To Payment button.

Sample sales transaction workflow showing the first state.

The second state specifies that when the button is clicked, the transaction is transformed to a customer payment. You could transform the transaction to a customer payment, customer refund, or a sample sales transaction. To permit the user to edit the transaction before saving, check the Redirect Without Saving box,

Sample sales transaction worklow showing the second state.

The following screenshot shows the button on the Sample Sales Transaction record.

Sample sales transaction workflow button.

Using Workflows with SuiteScript for Custom Transaction Transformations

To use SuiteScript to create a custom action to perform a transformation, use the redirect.toRecordTransform(options) method. The method takes the source transaction, opens the form of the destination transaction and fills data in the form based on the source transaction. If a field is available in both the source and destination transactions, it is transferred. However, the following fields are not automatically filled in:

  • Date – Today's date is displayed by default.

  • Due Date – Calculated from the Terms using today's date.

  • Accounts – If the main line account from the source transaction is not available in the target transaction, the default transaction account is used.

  • Status – The value of this field is not transferred.

For more information about the redirect.toRecordTransform(options) method, see N/redirect Module.

For more information about supported transformation types, see Supported Transformation Types.

Related Topics

Custom Transactions
Benefits of Custom Transaction Types
Sales and Purchase Transaction Types Overview
Custom Transaction Type Setup
Creating and Editing Custom Transaction Types
Custom Transaction Type Association with a Custom GL-Lines Plug-in Implementation
Custom Transaction Type Association with a SuiteTax Plug-in
Deleting Custom Transaction Types
Creating Sales and Purchase Custom Transaction Instances
Printing Custom Transaction Instances

General Notices