4

すべての InventoryItems のリストを取得したい このドキュメントによると: https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/getAll.html

次のリクエストを作成しています。

<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:platformMsgs="urn:platform_2013_1.webservices.netsuite.com" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header>
        <passport>
            <email>******</email>
            <password>******</password>
            <account>******</account>
        </passport>
    </env:Header>
    <env:Body>
        <platformMsgs:getAll>
            <recordType>InventoryItem</recordType>
        </platformMsgs:getAll>
    </env:Body>
</env:Envelope>

しかし、エラーで応答を受け取ります:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2013_1.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_969904_100920131651936419141601801_cbf1690968b43</platformMsgs:nsId>
        </platformMsgs:documentInfo>
  </soapenv:Header>
  <soapenv:Body>
      <getAllResponse xmlns="urn:platform_2013_1.webservices.netsuite.com">
          <platformCore:getAllResult xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com">
              <platformCore:status isSuccess="false">
                  <platformCore:statusDetail type="ERROR">
                      <platformCore:code>GETALL_RCRD_TYPE_REQD</platformCore:code>
                      <platformCore:message>The getAll record type is required.</platformCore:message>
                  </platformCore:statusDetail>
              </platformCore:status>
          </platformCore:getAllResult>
      </getAllResponse>
   </soapenv:Body>
</soapenv:Envelope>

通貨、州をリクエストしようとしましたが、応答は常に同じです

次のバリアントを試しました:

<GetAllRecordType>inventoryItem</GetAllRecordType>

<recordType>inventoryItem</recordType>

<GetAllRecordType>currency</GetAllRecordType>

<recordType>currency</recordType>

同じ応答で:

 <platformCore:message>The getAll record type is required.</platformCore:message>

https://webservices.netsuite.com/xsd/platform/v2013_2_0/coreTypes.xsdによると- recordType を正しく指定しました (ところで、成功せずに試してみました)

Ruby を使用していますが、Ruby 用の完全なライブラリはありません。存在するものには、私が使用するほとんどすべてのものは含まれていません。

誰かが私が間違っていることを助けてくれますか、または誰かが実際の例を持っているかもしれません

4

7 に答える 7

2

私は同じ問題でこの質問に出くわしました

<platformCore:message>The getAll record type is required.</platformCore:message>

このリクエストに適切な石鹸封筒がどのように見えるべきかのスニペットを投稿するようになると思いました. 他の人が言及したように、この呼び出しは特定のレコード タイプのみをサポートします...しかし、必要なレコード タイプを特定したら、以下のコードが役立ちます。

<soap:Envelope xmlns:platformFaults="urn:faults_2014_1.platform.webservices.netsuite.com" xmlns:platformMsgs="urn:messages_2014_1.platform.webservices.netsuite.com" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="urn:platform_2014_1.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Header>
        <passport>
            <email>test@example.com</email>
            <password>*******</password>
            <account>AccountNumber</account>
            <role internalId="3"/>
        </passport>
    </soap:Header>
    <soap:Body>
        <platformMsgs:getAll xmlns="urn:messages_2014_1.platform.webservices.netsuite.com" xmlns:platformMsgs="urn:messages_2014_1.platform.webservices.netsuite.com">
            <platformMsgs:record recordType="currency"/>
        </platformMsgs:getAll>
    </soap:Body>
</soap:Envelope>

また、node-soapモジュールを使用してこの Web サービスと通信しています。これも、その観点から見たものです。

soap.createClient(this.url, function (err, client) {
            client.addSoapHeader({
                passport: {
                    email: 'test@example.com',
                    password: 'pass',
                    account: 'Acct Number',
                    role: {
                        attributes: { internalId: 3 }
                    }
                }
            });
            client.getAll({
                "record": {
                  "attributes": {
                    "recordType": "currency"
                    }
                 }
           }, callback);
        });
});

とにかく、しばらくの間私を困らせたので、これが他の人に役立つことを願っています.

于 2014-09-16T15:55:28.510 に答える
2

Ruby での SuiteTalk の最も完全な実装は、netsuite ruby​​ gemです。

まだサポートしていませんItemSearchAdvanced(ほとんどの NetSuite レコードとは異なり、 がないことに注意してくださいItemSearchBasic)。また、期待するような 、 などInventoryItemAdvancedSearchがないことに注意してください。詳細については、スキーマ ブラウザNonInventoryItemAdvancedSearchを参照してください。lists.accounting.xsd

他の誰かが言及したように、getAllアイテム レコード タイプの呼び出しはありません。NetSuite インスタンス内のすべてのアイテムを取得するための最良の (そしておそらく唯一の) 方法は、検索によってページ分割を行い、すべての結果を結合することです。

NetSuite gem でアイテム検索を実装するために何をする必要があるかを示す簡単なハックをコーディングしました。参照されているハックを本番環境では使用しませんが、上記で参照されているハックの情報を使用して、アイテム検索を NetSuite gem に簡単に統合できますか。

以下は、上記のハックと組み合わせて使用​​すると、NetSuite インスタンス内のすべての項目を取得する検索コードです。

item_list = []
item_search = NetSuite::Records::InventoryItem.search(
  criteria: {
    basic: [

    ]
  },

  preferences: {
    page_size: 100,
  }
)

item_search.results_in_batches do |batch|
  item_list += batch
end

NonInventoryItem(上記のコードは、検索で 以外のや別のアイテム レコードが返された場合、おそらく壊れますが、InventoryItem開始するにはこれで十分なはずです)。

于 2013-10-15T14:46:23.530 に答える
1

Dave が示唆したように、リクエストでは大文字と小文字が区別されるため、使用する値が XSD の内容と正確に一致することを確認してください。

XSD をさらに下にスクロールすると、 のGetAllRecordType代わりにの列挙が表示されRecordTypeます。これには、または同様のエントリがないinventoryItemため、このタイプのリクエストではインベントリ アイテムを利用できない可能性が高くなります。

すべてのインベントリ アイテムを返すには、フィルターを使用せずにアイテム検索を作成する必要がある場合があります。

于 2013-10-09T17:41:22.833 に答える