Получение nlobjSearchFilter содержит недопустимый оператор или имеет неправильный синтаксис: internalid.при попытке добавить VendorBill - PullRequest
0 голосов
/ 21 февраля 2019

Я отправляю этот объект SOAP в API Netsuite Add.Я получаю этот ответ об ошибке:

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 голосов
/ 22 февраля 2019

После открытия заявки с поддержкой 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));
...