Forum Discussion

7 Replies

  • Hi Dan,

    I'm testing the API_DoQuery with the following code and I'm not getting any result. Could you help me?

    var promise = $.get(dbidcalendar, {

    act: "API_DoQuery",

              query: "{3.EX.178}",

              clist: "3"

    });

    $.when(promise).then(function(xml){

    var recordid = $("rid", xml).text();

    });


    I use something similar for API_AddRecord and API_EditRecord and it works very well. The APP does not have APPTOKEN
  • log the xml response:

    console.dirxml(xml);

    this will reveal the tag for the record is <record_id_> not <rid>
    • CarlosCarlos's avatar
      CarlosCarlos
      Qrew Assistant Captain
      Dan,
      is there a way to not use the field name, but use the field ID instead?
      from: $("record_id_", xml).text();
      to:      $('fid_3', xml).text();
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      You have to request "structured xml" like this:

      $.get(dbidcalendar, {
        act: "API_DoQuery",
        query: "{3.EX.178}",
        clist: "3.6.7.8",
        fmt: "structured"
      }).then(function(xml) {
        console.dirxml(xml);
        var fid6 = $("f[id=6]", xml).text();
        var fid7 = $("f[id=7]", xml).text();
        var fid8 = $("f[id=8]", xml).text();
      });

      Note your query will always contain just one record  so you can shorten the selectors to just asking for those nodes where the <f> element has an id attribute or 6, 7 or 8 respectively.