0

I have written below logic to post payment for a specific bill. I am however getting the error

INVALID FIELD VALUE","details":"You have entered an Invalid Field Value 129 for the following field: account"

I can see this account available, I tried accountid, acctnum and others. No luck so far !

function _post(context) {
   var vendorBillPayment = record.create({
            type: record.Type.VENDOR_PAYMENT,
            isDynamic: false,
            defaultValues: {
                entity: 1054
            }
        })

        vendorBillPayment.setValue({
            fieldId: 'entityname',
            value: "Nikon"
        })

        vendorBillPayment.setValue({
            fieldId: 'account',
            value: 129
        })

        vendorBillPayment.setValue({
            fieldId: 'currency',
            value: 1
        })

        vendorBillPayment.setValue({
            fieldId: 'customform',
            value: 45
        })

        vendorBillPayment.setValue({
            fieldId: 'exchangerate',
            value: "1.00"
        })

        var recordId = vendorBillPayment.save();
  }
Ashish Gupta
  • 1,651
  • 14
  • 30
  • Is 129 the internal ID of an account on the chart of accounts? Is it not set to “inactive”? Is 129 an account of type “Bank Account”? – Suite Resources Jan 23 '18 at 19:11
  • Yes, 129 is the internal id. It is not set to Inacitve . And It is Credit Card. However, I tried with other accounts (active, bank account). I can pull the account record using record.load. – Ashish Gupta Jan 24 '18 at 14:28

1 Answers1

2

Are you using NetSuite OneWorld? If you are you need to make sure that the account with internal id 129 can be used for the subsidiary of the Vendor you are using in the Vendor Payment record.

Rusty Shackles
  • 2,802
  • 10
  • 11
  • I might be missing something, but I am able to do the transaction from the UI. It's just that it is failing programatically using restlet – Ashish Gupta Jan 24 '18 at 14:30
  • Do you have any User Event scripts deployed in the Vendor Payment record? It might be triggered by your Restlet and then when that throws an error, it is passed to the Restlet and passed back to you? Your Restlet might be missing some information that is otherwise available to that script when you create the record in the UI. – Rusty Shackles Jan 25 '18 at 09:41
  • Is this a OneWorld account? The question was asked previously, but no answer given. If it is, you may need to add Subsidiary as a field on the RESTLet. In the UI, it may be set by default due to your role. – Suite Resources Jan 27 '18 at 22:41
  • @SuiteResources, my apologies. I was travelling. I am using One World with multiple subsideries and I have added subsidary as 1 (default). The error is now changed to INVALID_FLD_VALUE\",\"message\":\"You have entered an Invalid Field Value 1 for the following field: subsidiary\",\"stack\":[\"anonymous(N/recordService) . – Ashish Gupta Feb 20 '18 at 21:06