You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Restlet(SS2)提交NetSuite供应商付款时遇账户字段无效报错

Troubleshooting "INVALID FIELD VALUE" for Account in NetSuite Vendor Payment Creation

Let's break down why you're hitting this INVALID FIELD VALUE error for the account field in your NetSuite Vendor Payment script, and how to fix it:

Common Causes & Fixes

1. Verify the Account's Internal ID is Correct & Valid

The error message says "Invalid Field Value 129 for account"—first, double-check that 129 is the correct internal ID of a valid payment account (like a bank account, since vendor payments require a spendable account).

  • In NetSuite, navigate to the account record and check the URL: the number after id= is the internal ID (e.g., https://your-account.netsuite.com/app/accounting/accounts/register.nl?id=129).
  • Ensure the account is not marked inactive (check the "Is Inactive" checkbox on the account record) and is assigned to your current subsidiary (if using a multi-subsidiary setup).

2. Confirm the Field ID is Correct

You mentioned trying accountid and acctnum—for native NetSuite Vendor Payment records, the correct field ID for the payment account is account in static mode. To be 100% sure:

  • Go to Customization > Lists, Records, & Fields > Record Types > Vendor Payment > Fields and look for the "Account" field to confirm its ID (no custom prefix like custrecord_ should be present).

3. Check Static Mode Value Formatting

Since you're using isDynamic: false, the value type must match the field's data type. The account field expects a numeric internal ID, so passing 129 (as a number, not string) is correct. However:

  • Avoid passing unnecessary string values (like "1.00" for exchangerate—use the numeric 1.00 instead, as it's a currency field).

4. Try Dynamic Mode (Alternative Approach)

Sometimes static mode has edge cases with field dependencies. Switching to dynamic mode can resolve this, as it mimics manual record creation:

function _post(context) {
  var vendorBillPayment = record.create({ 
    type: record.Type.VENDOR_PAYMENT, 
    isDynamic: true, 
    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();
}

5. Rule Out Permissions

Ensure the role executing the script has full access to the account record. Test running the script with an administrator role to eliminate permission-related issues.


内容的提问来源于stack exchange,提问作者Ash

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:02:26