Redirecting After Hidden "RID" Input Changes on New Records

  • 1
  • 1
  • Question
  • Updated 9 months ago
So the task I have been trying to accomplish entails that after a new record is added, we need to use API_CloneMasterDetail to copy a template record's report link. The main issue I ran into with this was obtaining the new record's Record ID# before the form redirected to my RedirectURL.

I found though that there is a <input type="hidden" name="rid" value"" /> where the value is a long integer (no idea what it represents), when adding a new record and is the Record ID# when messing with an existing record. For new records, the hidden input changes right before the redirect takes place. So, I wired up an event handler to track when the hidden input changes to the new Record ID# and then I window.location.replace() to my code page with the new Record ID# as a URL Parameter.

While this allows me to run the API_CopyMasterDetail request as desired, and the new record is created with the new copied report link, I wanted to check if anyone knew if redirecting this way at this stage after the hidden input changes would break/not run an important Quick Base task? Or, is redirecting manually at this stage pretty much the same as letting the RedirectURL do its thing?

The reason I can't use RedirectURL at this point, is updating the RedirectURL after the hidden input is updated doesn't seem to get respected when Quick Base decides to redirect - it uses the old value before the hidden input was updated.
Photo of Zach Case

Zach Case

  • 234 Points 100 badge 2x thumb
  • happy

Posted 9 months ago

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

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,322 Points 20k badge 2x thumb
Partial answer. That rid value you see is a sentinel value of 32 1's (binary)

4294967295 = 0b11111111111111111111111111111111

There might be some AJAX going on just before the new record form submits which supplies the newly created [Record ID#] value.

I don't have time to look at other aspects your post raises at this time.
(Edited)
Photo of Zach Case

Zach Case

  • 234 Points 100 badge 2x thumb
So I do already have the newly created [Record ID#] at the point I do the window.location.replace(). Right before Quick Base redirects you, <input type="hidden" name="rid" /> updates it's value to the new entries [Record ID#].

Really my main question is, at this point, since the record has obviously been created at this point - because I have the [Record ID#] - would I be skipping a Quick Base process, other than its native redirect, by doing a manual window.location.replace()?

No worries if you don't have the time, I really appreciate your help today. I might try to by pass this issue by just making my own AJAX call to my code page and allowing Quick Base to do it's native redirect. 
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,322 Points 20k badge 2x thumb
If you are that deep into scripting I don't see any purpose in relying on QuickBase's redirect mechanism. Just control the whole process with script and you don't have to play guessing games or perform lots of experiments figuring out what these hidden parameters do on the back end.

There are a lot of remnants of techniques that might have been cutting edge in 2000 that are still in the code base. I can't image who would use a sentinel value today for just about anything. Redirect parameters? XML not JSON? The list is long.

Luckily we have excellent developers and product managers who are modernizing the product with help from the future.