Skip to main content
Question

ifv not working with API_AddRecord?

  • September 21, 2023
  • 0 replies
  • 187 views

Hey all, has anyone else encountered this? I'm using a rich text button to (among other things) add and display a new record in one fell swoop. However, I cannot get it to respect my &ifv=10 settings, it's still pulling up the new record in a form with full QB branding and navigation. 

var text NewTimeSheet = URLRoot() & "db/" & [_DBID_CREW_TIME_RECORDS] & "?act=API_AddRecord"
& "&apptoken=XXXXXX"
& "&_fid_37=" & [Record ID#]
& "&ifv=10"
& "&disprec=1"
;

#APIsandcustomcode #api_addrecord 



------------------------------
Elena Larrabee
------------------------------

QuickBaseJunkie
Forum|alt.badge.img+15

Without seeing the full formula, I think what you may be looking for is:

?a=nwr in place of where you have ?act=API_AddRecord

The API_AddRecord happens behind the scenes and requires a redirect to say what to display after the new record is created. However, since the record isn't created at the time the button is pressed there is no way to capture the new record's ID to display it in the the redirect. There are some ways of doing this, but they are quite complex.

Using nwr (or API_GenAddRecordForm) simply passes the values you want to a new record but the user is responsible for saving it. This means you will still need a custom save button on your form when using the ifv=10.

I teach both APIs and Rich Text buttons in the Quick Base Junkie Button Bundle if you want to learn more.

-Sharon



------------------------------
Quick Base Junkie
Sharon Faust
https://quickbasejunkie.com
------------------------------