Discussions

Expand all | Collapse all

Pass value to your custom code page

  • 1.  Pass value to your custom code page

    Bronze
    Contributor
    Posted 03-20-2019 00:29
    I setup the the user defined variable required to run scripts off of formula URL field button click

    I am currently using:

    var dbid = "xxxxxx";
     
    var promise = $.post(dbid, {
      act: "API_GetRecordInfo",
      rid: "6400",
    });

    $.when(promise).then(function(xml) {
      console.dirxml(xml);
      console.log($("errcode", response).text());
    });
    My issue is that the record ID I have there is hard coded. I would like to pass the record ID of the record I am inside to the code page, to run GetRecordInfo for the record I am on. Where can I read to learn how to do this or can I have some guidance?





  • 2.  RE: Pass value to your custom code page

    Bronze
    Contributor
    Posted 03-20-2019 01:21
    So I am not sure if anyone has a better way... but since I am running the script on the page, there is a variable on the page called kRid that seems to hold the record ID for whatever record you are in. It seems to be working for me but I am unsure if it is the best way


  • 3.  RE: Pass value to your custom code page

    Bronze
    Contributor
    Posted 03-20-2019 22:57
    So is this actually a QB code page? My general practice when doing something like this is to pass the rid as a parameter in the url - so along the line of

    https://realm.quickbase.com/db/abcd1234?a=dbpage&pageid=10&rid=1000

    Then with a little window.location manipulation in Javascript you can parse out what the rid value is and you can pass that into your code

    Chayce Duncan | Technical Lead
    (720) 739-1406 | chayceduncan@quandarycg.com
    Quandary Knowledge Base