Skip to content

Determine Deposited Status of CustomerRefunds in NetSuite

Tags: netsuite • Categories: Web Development

Table of Contents

Most payment and refund records in NetSuite have a straightforward way to determine if they’ve been deposited or not. The CustomerRefund is one exception: there is no way to determine from the GUI, or from the SuiteTalk API response for a CustomerRefund, if a given CustomRefund has been linked to a deposit record.

However, you can search for CustomerRefunds which are deposited or undeposited using a couple poorly documented search filters:

NetSuite::Records::CustomerRefund.search(
  criteria: {
    basic: [
      {
        field: 'type',
        operator: 'anyOf',
        value: [ '_customerRefund' ]
      },
      {
        field: 'applyingLinkType',
        operator: 'noneOf',
        value: [ '_depositRefundCheck' ]
      },
      {
        field: 'mainLine',
        value: true
      },
      {
        field: 'account',
        operator: 'anyOf',
        # undep funds account reference
        value: [ NetSuite::Records::RecordRef.new(internal_id: 6) ]
      }
    ]
  },
  preferences: {
    page_size: 250
  }
)

Keep in Touch

Subscribe to my email list to keep in touch. I’ll send you new blog posts and other thoughts.