获取nlobjSearchFilter包含无效的运算符,或者语法不正确:internalid。尝试添加VendorBill时

时间:2019-02-20 22:46:50

标签: soap netsuite suitetalk

我正在将此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
  }
}

1 个答案:

答案 0 :(得分: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));