After Scooby Doo, want to grab information of the recently created field (Where are You techniques)

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

After Scooby Doo, want to grab information of the recently created field (Where are You techniques)

 

 

I am starting to implement “WHERE ARE YOU”  simple things, such as pick a field information of a recently created record, mix it with something and do a query in another table to produce some results to inform the user something about the recently created record (Dan’s implementation for dummies ended up in editing the record)

 

I am able to pick the rid , and do a query (console.dirxml(xml); is ok), but I am stuck in extracting the information in a Variable.

 

I was able to do it before with API_GenResultsTable";

 

testePegar is the tag of fid 13.

 

if (/nwr/i.test(querystring)) {

 

    $("<iframe>", {id: "QBU_editform", name: "QBU_editform"})

      .css({display: "none"})

      .appendTo("body")

      .on("load", function() {

        QBbusyHide();

        var rid = this.contentWindow.kRid;

        alert(rid);

 

        $.post(dbidTable, {

          act: "API_DoQuery",

          clist: 13,

          query: "{3.EX." + rid + "}"

 

        }).then(function(xml) {

 

           var pegar = $("testePegar", xml).map(function() {

            return $(this).text();

          }).get();

           console.dirxml(xml);

           console.log(pegar);

 });

 

No var pegar!!

Can someone help

Photo of eduardo

eduardo

  • 40 Points

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
This will return an array pegar of all the <testPegar> field values in each record of the XML response:

   var pegar = $("record", xml).map(function() {
    return $("testePegar", this).text();
  }).get();
Photo of eduardo

eduardo

  • 40 Points
Thanks problem solved. YES, don't know why no was selected
Photo of John

John

  • 0 Points
How do I get a list of all the multi-choice field values from a table, so I can populate a select drop-down on my html page via an api call?
Photo of John

John

  • 0 Points
Photo of John

John

  • 0 Points
How about getting the field options for a look up field?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
The field properties of a lookup field would be revealed by calling API_GetSchema on the parent table where the field being looked up is located. This will require knowing the application token . If you don;t know the application token a priori you could extract the field properties by using gimmeAllTheDatas technique.