2

我将此 SOAP 对象发送到 Netsuite Add API。我收到此错误响应:

nlobjSearchFilter 包含无效的运算符,或者语法不正确:internalid。

有没有人在添加操作中看到这个错误?我也不确定为什么在我的添加操作中出现搜索过滤器错误。

object(AddRequest)#10 (1) {
  ["record"]=>
  object(VendorBill)#15 (50) {
    ["createdDate"]=>
    NULL
    ["lastModifiedDate"]=>
    NULL
    ["nexus"]=>
    NULL
    ["subsidiaryTaxRegNum"]=>
    NULL
    ["taxRegOverride"]=>
    NULL
    ["taxDetailsOverride"]=>
    NULL
    ["customForm"]=>
    NULL
    ["billAddressList"]=>
    NULL
    ["account"]=>
    NULL
    ["entity"]=>
    object(RecordRef)#19 (4) {
      ["internalId"]=>
      string(6) "561643"
      ["externalId"]=>
      NULL
      ["type"]=>
      NULL
      ["name"]=>
      NULL
    }
    ["subsidiary"]=>
    NULL
    ["approvalStatus"]=>
    NULL
    ["nextApprover"]=>
    NULL
    ["vatRegNum"]=>
    NULL
    ["postingPeriod"]=>
    object(RecordRef)#31 (4) {
      ["internalId"]=>
      string(3) "209"
      ["externalId"]=>
      NULL
      ["type"]=>
      NULL
      ["name"]=>
      NULL
    }
    ["tranDate"]=>
    string(18) "2018-10-31T6:00:00"
    ["currencyName"]=>
    NULL
    ["billingAddress"]=>
    NULL
    ["exchangeRate"]=>
    NULL
    ["entityTaxRegNum"]=>
    NULL
    ["terms"]=>
    NULL
    ["dueDate"]=>
    NULL
    ["discountDate"]=>
    NULL
    ["tranId"]=>
    string(15) "30943011-148338"
    ["userTotal"]=>
    NULL
    ["discountAmount"]=>
    NULL
    ["taxTotal"]=>
    NULL
    ["paymentHold"]=>
    NULL
    ["memo"]=>
    string(15) "30943011-148338"
    ["tax2Total"]=>
    NULL
    ["creditLimit"]=>
    NULL
    ["availableVendorCredit"]=>
    NULL
    ["currency"]=>
    NULL
    ["class"]=>
    object(RecordRef)#28 (4) {
      ["internalId"]=>
      int(1)
      ["externalId"]=>
      NULL
      ["type"]=>
      NULL
      ["name"]=>
      NULL
    }
    ["department"]=>
    object(RecordRef)#24 (4) {
      ["internalId"]=>
      string(1) "1"
      ["externalId"]=>
      NULL
      ["type"]=>
      NULL
      ["name"]=>
      NULL
    }
    ["location"]=>
    object(RecordRef)#16 (4) {
      ["internalId"]=>
      int(2)
      ["externalId"]=>
      NULL
      ["type"]=>
      NULL
      ["name"]=>
      NULL
    }
    ["status"]=>
    NULL
    ["landedCostMethod"]=>
    NULL
    ["landedCostPerLine"]=>
    NULL
    ["transactionNumber"]=>
    NULL
    ["expenseList"]=>
    NULL
    ["accountingBookDetailList"]=>
    NULL
    ["itemList"]=>
    object(VendorBillItemList)#29 (2) {
      ["item"]=>
      array(1) {
        [0]=>
        object(VendorBillItem)#13 (36) {
          ["item"]=>
          object(RecordRef)#14 (4) {
            ["internalId"]=>
            string(2) "45"
            ["externalId"]=>
            NULL
            ["type"]=>
            NULL
            ["name"]=>
            NULL
          }
          ["vendorName"]=>
          NULL
          ["line"]=>
          NULL
          ["orderDoc"]=>
          NULL
          ["orderLine"]=>
          NULL
          ["quantity"]=>
          string(1) "1"
          ["units"]=>
          NULL
          ["inventoryDetail"]=>
          NULL
          ["description"]=>
          NULL
          ["serialNumbers"]=>
          NULL
          ["binNumbers"]=>
          NULL
          ["expirationDate"]=>
          NULL
          ["taxCode"]=>
          NULL
          ["taxRate1"]=>
          NULL
          ["taxRate2"]=>
          NULL
          ["grossAmt"]=>
          NULL
          ["tax1Amt"]=>
          NULL
          ["rate"]=>
          string(5) "26.95"
          ["amount"]=>
          NULL
          ["options"]=>
          NULL
          ["department"]=>
          NULL
          ["class"]=>
          NULL
          ["location"]=>
          NULL
          ["customer"]=>
          object(RecordRef)#35 (4) {
            ["internalId"]=>
            string(6) "655853"
            ["externalId"]=>
            NULL
            ["type"]=>
            NULL
            ["name"]=>
            NULL
          }
          ["landedCostCategory"]=>
          NULL
          ["isBillable"]=>
          NULL
          ["billVarianceStatus"]=>
          NULL
          ["billreceiptsList"]=>
          NULL
          ["amortizationSched"]=>
          NULL
          ["amortizStartDate"]=>
          NULL
          ["amortizationEndDate"]=>
          NULL
          ["amortizationResidual"]=>
          NULL
          ["taxAmount"]=>
          NULL
          ["taxDetailsReference"]=>
          NULL
          ["landedCost"]=>
          NULL
          ["customFieldList"]=>
          object(CustomFieldList)#32 (1) {
            ["customField"]=>
            array(2) {
              [0]=>
              object(LongCustomFieldRef)#30 (3) {
                ["value"]=>
                string(7) "2722217"
                ["internalId"]=>
                string(17) "custcoloriginalpo"
                ["scriptId"]=>
                NULL
              }
              [1]=>
              object(LongCustomFieldRef)#27 (3) {
                ["value"]=>
                string(1) "1"
                ["internalId"]=>
                string(21) "custcoloriginalpoline"
                ["scriptId"]=>
                NULL
              }
            }
          }
        }
      }
      ["replaceAll"]=>
      NULL
    }
    ["landedCostsList"]=>
    NULL
    ["purchaseOrderList"]=>
    NULL
    ["taxDetailsList"]=>
    NULL
    ["customFieldList"]=>
    object(CustomFieldList)#36 (1) {
      ["customField"]=>
      array(2) {
        [0]=>
        object(LongCustomFieldRef)#38 (3) {
          ["value"]=>
          string(6) "148338"
          ["internalId"]=>
          string(15) "custbodyjobs_no"
          ["scriptId"]=>
          NULL
        }
        [1]=>
        object(LongCustomFieldRef)#37 (3) {
          ["value"]=>
          string(6) "237656"
          ["internalId"]=>
          string(13) "custbody_e3id"
          ["scriptId"]=>
          NULL
        }
      }
    }
    ["internalId"]=>
    NULL
    ["externalId"]=>
    NULL
    ["nullFieldList"]=>
    NULL
  }
}
4

1 回答 1

0

在使用 NetSuite 支持打开票证后,我了解到 nlobjSearchFilter 是其服务器端 java 脚本触发器中使用的对象。所以问题实际上出在服务器端自定义触发器中。

这一行:

if (originalPOID != null)
            searchForPO = nlapiSearchRecord('purchaseorder',null, new nlobjSearchFilter('internalid', null, 'is', originalPOID));

需要像这样更安全的检查:

if (originalPOID != '' && originalPOID != null)
            searchForPO = nlapiSearchRecord('purchaseorder',null, new nlobjSearchFilter('internalid', null, 'is', originalPOID));
于 2019-02-22T19:44:00.780 回答