Setting field values when using a=er within a formula URL

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

Hi,

I've created a formula text HTML link using the a=er option as shown here:

http://quickbase.intuit.com/developer/articles/using-zrurl-and-rdr-formula-url-fields

to make use of the "&z="&Rurl() to take the user back to where-ever they came from before clicking on the button.

However, I want certain field to be autopopulated with preset values (hardcoded into the formula URL) - for example to change the status of the record.

I thought I knew how to do this, and merrily added (for example) '&_fid_10=1' thinking field ID 1 would automatically be set to '1' when the user opened the form - but alas not.

URLRoot()
& "db/"
& Dbid()
& "?a=er&rid=" & URLEncode([Record ID#])
& "&_fid_10=" & URLEncode("1")
& "&dfid=12"
& "&z="
& Rurl()

I know how to do this using the edit record API, but that does not give me the option to return the user to where they came from (using the Rurl() solution) after they have made any further manual amendments and saved the record.

Am I just coding the URL incorrectly, or am I trying to achieve the impossible?

If I cannot do this using the a=er approach and have to use the Edit Record API, am I right in thinking that there is no equivalent to the "&z="&Rurl() solution for returning users to their original locations when using the API?

Thanks

David

Photo of David

David

  • 60 Points

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,448 Points 50k badge 2x thumb
Ya, I recently came across this too.  I came to the conclusion that it only works when you use a real API, like API_AddRecord or API_EditRecord or API_GenAddRecordForm.  I looked at that API (again), but could not find an api like "API_GenEditRecordForm".

As for z=Rurl() , as for as i know this is still valid.

http://quickbase.intuit.com/developer/articles/using-zrurl-and-rdr-formula-url-fields
Photo of David

David

  • 836 Points 500 badge 2x thumb
I've been looking for a solution to this too. I tested with adding a record 'ar' and the field fills, edit 'er' and it doesn't. The API doesn't help if we expect the user to add additional info. Frustrating.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,448 Points 50k badge 2x thumb
If you don't need the z=Rurl() function, you can edit the record and then put up the edit record form.
Photo of David

David

  • 60 Points
Yep - it's easy when you don't need to return the user to where they came from, or you want to always return them to the same place. But my use case involves use of the 'button' from multiple different locations, so I need the z=Rurl() functionality.
)-:
Photo of David

David

  • 836 Points 500 badge 2x thumb
QBC, that makes sense, but I don't want that field saved until the user chooses to save the record.
Photo of Jared

Jared

  • 0 Points
Hi Eweraka,

Try this formula Structure:

URLRoot() & "db/" & [_DBID_TASKS] & "?a=API_EditRecord&rid="&[Record ID#]&"&_fid_12=" & URLEncode("Canceled")& "&rdr="&URLEncode(URLRoot() & "db/" & [_DBID_TASKS] & "?a=er&rid="&URLEncode([Record ID#])&"&z="&Rurl())


Best,