2 Replies Latest reply: Nov 8, 2016 10:16 AM by Marcus Sommer RSS

    Simple For Each Question

    Pierre de Chanville

      Hello together,

       

      I' ve adapted a Query of a colleague, the requirement is a loop.

      We' re working with pixi (ERP) and using APIs to get any Information...

       

      With this Script we' d like to get the available & physical stock of an Item.

      For the API, we' ve to put in the EAN Code to get an result.

       

      Loading all EANs

      LOAD

      EANUPC as EAN

      // ItemNrInt

      FROM [lib://pixiReadItems (nickismode_administrator)]

      (XmlSimple, table is [Envelope/Body/pixiReadItemsResponse/pixiReadItemsResult/SqlRowSet/diffgram/SqlRowSet1/row]);

       

      Put them into the API with a Loop

      FOR Each BN in FieldValueList('EAN')

      [Pixi Get Item Infos]:

       

      Webfile, generated with QV Source

      Let Libr =

      'http://localhost:5555/QVSource/WebConnectorV2/?table=RawResponse&verb=POST&url=https%3a%2f%2fapi.pixi.eu%2fsoap%2fpixiNIC%2f%3fwsdl&data=%3csoapenv%3aEnvelope+xmlns%3asoapenv%3d%22http%3a%2f%2fschemas.xmlsoap.org%2fsoap%2fenvelope%2f%22+xmlns%3apix%3d%22https%3a%2f%2fapi.pixi.eu%2fsoap%2fpixiNIC%2f%22%3e%0a+++%3csoapenv%3aHeader%2f%3e%0a+++%3csoapenv%3aBody%3e%0a++++++%3cpix%3apixiGetItemStock%3e%0a+++++++++%3cpix%3aEAN%3e'&'$(BN)'&'%3c%2fpix%3aEAN%3e%0a++++++%3c%2fpix%3apixiGetItemStock%3e%0a+++%3c%2fsoapenv%3aBody%3e%0a%3c%2fsoapenv%3aEnvelope%3e&contentType=text%2fxml%3bcharset%3dUTF-8&headers=https%3a%2f%2fapi.pixi.eu%2fsoap%2fpixiNIC%2fpixiGetItemStock&UserName=pixiNIC&PasswordEncrypted=Vd5%2fe1luRn2NGe2eMc3oYHXd2wS6CHyy&appID=';

       

      Reading the needed Information

      Load

      AvailableStock,

      PhysicalStock,

      PhysicalStockAllLocations,

      // SupplPrice,

      // ItemKey,

      EANUPC as EAN

      // ItemNrSuppl,

      // ItemNrInt

      FROM [lib://pixiGetItemStock (nickismode_administrator)]

      (XmlSimple, table is [Envelope/Body/pixiGetItemStockResponse/pixiGetItemStockResult/SqlRowSet/schema]);

       

      next BN

       

       

      but it doesn' t work the way we wanted to.

      It loads and loads but there' s no result... I hope you can help me.

       

      Regards

       

      Christoph