Forum Discussion
TylerJablonski1
3 years agoQrew Trainee
I did some testing on my own and it looks like if you have an API_GenAddRecordForm link in a formula URL field, Quickbase is automatically appending "&masterRid=[Record ID#]" to the end of it. This returns you to the master record even if you didn't put "&z=Rurl()" at the end of your link. I don't remember it working like this in the past, but maybe I'm remembering wrong. Either way, not a huge fan of this.
The workaround is to use a formula rich text field instead, which should look like this:
var text url = URLRoot() & "db/" & [_DBID_CUSTOMERS] & "?a=API_GenAddRecordForm";
"<a href='"&$url&"' class='Vibrant'>New Customer</a>"
Quickbase will not apply the masterRid URL parameter if the link is in a rich text formula field.
A neat idea to expand on your original solution would be to create a checkbox field in the customers table called "Opened from search" that's hidden from the add record form. You can use API_GenAddRecordForm to set the checkbox equal to yes when you click on the button in the search table. Then you can add a custom data rule in the customers table to display an error message if the user is in a certain role and the checkbox isn't checked. This would prevent users from going directly to the customers table and adding a record without searching first.
------------------------------
Tyler Jablonski
------------------------------
The workaround is to use a formula rich text field instead, which should look like this:
var text url = URLRoot() & "db/" & [_DBID_CUSTOMERS] & "?a=API_GenAddRecordForm";
"<a href='"&$url&"' class='Vibrant'>New Customer</a>"
Quickbase will not apply the masterRid URL parameter if the link is in a rich text formula field.
A neat idea to expand on your original solution would be to create a checkbox field in the customers table called "Opened from search" that's hidden from the add record form. You can use API_GenAddRecordForm to set the checkbox equal to yes when you click on the button in the search table. Then you can add a custom data rule in the customers table to display an error message if the user is in a certain role and the checkbox isn't checked. This would prevent users from going directly to the customers table and adding a record without searching first.
------------------------------
Tyler Jablonski
------------------------------