获得nlobjsearchFilter包含无效的操作员,或者不在适当的语法中:internalID.尝试添加供应商时



我将此肥皂对象发送到NetSuite添加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
  }
}

在用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));

最新更新