Pass value to your custom code page

  • 0
  • 1
  • Question
  • Updated 1 month ago
  • In Progress
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?



Photo of Jordan

Jordan

  • 1,644 Points 1k badge 2x thumb

Posted 1 month ago

  • 0
  • 1
Photo of Jordan

Jordan

  • 1,644 Points 1k badge 2x thumb
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
Photo of Chayce Duncan

Chayce Duncan

  • 2,002 Points 2k badge 2x thumb
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