Ken Jeong
Ken Jeong

Reputation: 31

How to load invoice record in SuiteScript?

require(['N/search','N/record'])

var search = require('N/search')
var record = require('N/record')
var invoice = record.load({
      type: record.Type.INVOICE,
      id: 444283
    })

log.debug('invoice',invoice)

Hi everyone can someone heelp me figure out how to properly load invoice records, vendor bills/credits ? i try this simple record.load with this enum type and i get errors of:

"name":"INVALID_TRANS_TYP","message":"Transaction type specified is incorrect.",

Upvotes: 1

Views: 1032

Answers (1)

erictgrubaugh
erictgrubaugh

Reputation: 8847

That error would seem to indicate that the Transaction with Internal ID 444283 is not actually an Invoice. Verify your internal ID and transaction type match up.

Upvotes: 1

Related Questions