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.

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

  1. Navigate to Customization > Workflow > Workflows > New.
  2. 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:

  1. Initiation: Event Based.
  2. On Create: checked.
  3. On View or Update: unchecked. If it is checked, every save flips the sign again.
  4. Trigger Type: Before Record Submit.
  5. Event Type: Create.
  6. 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:

  1. Field: Bank
  2. Compare Type: equal
  3. 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.

  1. In the Workflow Manager's right-hand panel, click the Workflow tab, then the Fields subtab, then New Field.
  2. Label: Temp Debit
  3. ID: _temp_debit. NetSuite saves it as custworkflow_temp_debit.
  4. Type: Decimal Number
  5. Store Value: unchecked
  6. 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.
OrderAction nameFieldValue
1Save the original DebitTemp Debit (the workflow field)Select Formula (the radio button under From Field, next to the grey box) and enter {custrecord_ngob_banktran_debit}
2Move Credit into DebitDebitField > Credit (custrecord_ngob_banktran_credit)
3Move the saved Debit into CreditCreditFormula: {custworkflow_temp_debit}
4Flip the AmountAmount (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:

  1. Logged in as the owner, go to the NetCash Bank Transaction list and click New.
  2. 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.
  3. On the saved record, check that:
    • Amount is negated.
    • Debit and Credit are swapped.
    • The Workflow History subtab shows all four actions ran.
  4. Edit and save the record again. Amount should not flip back. This confirms On View or Update is off.
  5. Create one test record on a different bank account. The workflow should not run.
  6. Delete the test records.

Step 7: Release the workflow and check a real sync

  1. Change Release Status to Released.
  2. Wait for the next Plaid sync, or ask the customer to run it.
  3. Open a few newly imported transactions on that account and compare them to the bank portal.
  4. In NetCash, confirm deposits and withdrawals appear on the correct side of the matching page.

Related links


Was this article helpful?