Skip to main content
Question

Open record in another form and change the value of a field

  • September 28, 2017
  • 0 replies
  • 257 views

Hi

I'm trying to add a button which will open the same record in a different form but at the same time editing a field within that form.

i have this so far which opens the record in the other form but what i cant figure out is how to add in the piece which will edit the checkbox field to true. The checkbox field id is 155.

URLRoot() & "db/" & Dbid() & "?a=er&key="&[Record ID#]&"&dfid=11"

Any guidance would be appreciated 

Thanks
This topic has been closed for replies.

So you cannot actually populate a checkbox field when opening the record to edit.

The only option would be to actually have that checkbox set to checked under the covers and then display the record in Edit mode.

The subtle difference is that when the user clicks the button, that checkbox will be checked, regardless if they choose to back out of the edit process and not actually save the record.

The code would be in two steps like this, using formula variables for each step.

var Checkbox= URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=xxxxxxx"
& "&_fid_155=1;

var Edit = URLRoot() & "db/" & Dbid() & "?a=er&key="&[Record ID#]&"&dfid=11";

$Checkbox
& "&rdr=" & URlEncode($Edit)


If you have application tokens set to be required you will need to supply that line
& "&apptoken=xxxxxxx"

or else disable them on the Settings in App properties and then you don't need that line.

  • Registered
  • September 28, 2017
I create a simple application:

Edit Record With Field Override ~ Edit Record #1
https://haversineconsulting.quickbase.com/db/bm5ep5eb7?a=er&rid=1

You can tack on parameters to the URL that will set values for _fid_6 and/or _fid_7 immediately when the form opens.

?a=er&rid=1&_fid_6=Jane Doe&_fid_7=4/5/2018
?a=er&rid=1&_fid_6=John Doe&_fid_7=1/2/2019

I modified the pastie slightly to not change the field unless a value is supplied in the URL:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=600

The example hardcoded processing of only these two fids but it would not be difficult to modify the script to process any supplied fid.

FWIW, the reason QuickBase probably did not implement this feature on ?a=er (but they did on ?a=nwr) might be because you loose knowledge of what the old value of the field was so it is probably a safety thing.