NetCash - Plaid transactions imported with the wrong sign
Overview
In some cases, Plaid imports bank transactions with the wrong sign: debits arrive as credits and credits arrive as debits. Deposits and withdrawals then show on the wrong side of the matching page, and transactions will not match their GL counterparts.
As a workaround, create a NetSuite workflow on the NetCash Bank Transaction record that reverses the sign of each transaction as it is imported. The workflow runs only for the affected bank account. This article walks through building, testing, and releasing it.
Apply this only to the affected account
The workflow swaps Debit and Credit and negates Amount on every new transaction it runs on. If it runs on an account that already imports correctly, those transactions will be wrong. Always limit the workflow to the one account that has the problem (Step 3).
The workflow affects new transactions only
It runs when a transaction is created. Transactions already imported with the wrong sign are not changed.
Prerequisites
- A NetSuite role that can create and edit workflows (for example, Administrator).
- The name of the bank account that imports with the wrong sign.
- One example transaction from that account, with its Amount, Debit or Credit value, Date, and Description. You use it to test in Step 6.
- The context the Plaid sync runs in (Map/Reduce, Scheduled, or both). If you are not sure, select all contexts in Step 2. The condition in Step 3 still limits the workflow to the one account.
Step 1: Create the workflow
- Navigate to Customization > Workflow > Workflows > New.
- Fill in the header:
- Name: Flip Plaid Sign - [bank account name]
- ID: _flip_plaid_sign. NetSuite adds the customworkflow prefix.
- Record Type: NetCash Bank Transaction
- Owner: yourself, so you can test it in Step 6.
- Release Status: Testing
- Keep Instance and History: Always. This lets you see on each record whether the workflow ran.
- Execute as Admin: checked
Step 2: Set the initiation
In the Event Definition section:
- Initiation: Event Based.
- On Create: checked.
- On View or Update: unchecked. If it is checked, every save flips the sign again.
- Trigger Type: Before Record Submit.
- Event Type: Create.
- Context Type: select the context the sync uses (Map/Reduce and/or Scheduled), plus User Interface so you can test manually. If you are not sure which context the sync uses, select all of them.
Step 3: Limit the workflow to the affected account
Still in the Event Definition section, click the Condition field and use the Visual Builder:
- Field: Bank
- Compare Type: equal
- Selection: the affected bank account
Click Set, then Save. NetSuite creates the workflow with State 1 and opens the Workflow Manager diagram.
Step 4: Add a temporary workflow field
This field holds the original Debit value while the workflow swaps Debit and Credit.
- In the Workflow Manager's right-hand panel, click the Workflow tab, then the Fields subtab, then New Field.
- Label: Temp Debit
- ID: _temp_debit. NetSuite saves it as custworkflow_temp_debit.
- Type: Decimal Number
- Store Value: unchecked
- Click Save.
Step 5: Add four actions to State 1
Click State 1, then the State tab, then Actions > New Action > Set Field Value. Repeat for each of the four actions below, in this order. For every action:
- Trigger On: Before Record Submit.
- Condition: leave blank. The workflow condition already limits it to the one account.
| Order | Action name | Field | Value |
|---|---|---|---|
| 1 | Save the original Debit | Temp Debit (the workflow field) | Select Formula (the radio button under From Field, next to the grey box) and enter {custrecord_ngob_banktran_debit} |
| 2 | Move Credit into Debit | Debit | Field > Credit (custrecord_ngob_banktran_credit) |
| 3 | Move the saved Debit into Credit | Credit | Formula: {custworkflow_temp_debit} |
| 4 | Flip the Amount | Amount (custrecord_ngob_banktran_amount) | Formula: {custrecord_ngob_banktran_amount} * -1 |
The order matters. Action 1 must run first so the original Debit is saved before action 2 overwrites it.
Step 6: Test in Testing status
In Testing status, a workflow instance starts only for the workflow owner. The Plaid sync will not trigger it yet, so test manually:
- Logged in as the owner, go to the NetCash Bank Transaction list and click New.
- Fill in the required fields. Use the affected bank account and the values from your example transaction (Amount, Debit or Credit, Date, Description). Click Save.
- On the saved record, check that:
- Amount is negated.
- Debit and Credit are swapped.
- The Workflow History subtab shows all four actions ran.
- Edit and save the record again. Amount should not flip back. This confirms On View or Update is off.
- Create one test record on a different bank account. The workflow should not run.
- Delete the test records.
Step 7: Release the workflow and check a real sync
- Change Release Status to Released.
- Wait for the next Plaid sync, or ask the customer to run it.
- Open a few newly imported transactions on that account and compare them to the bank portal.
- In NetCash, confirm deposits and withdrawals appear on the correct side of the matching page.
