Forum Discussion
MichaelTamoush
6 years agoQrew Captain
Thanks Brandon.
One of my related fields uses the record ID for key, and is numeric. The other uses a related field that is not the record ID, and is a Unique key field that is text. How would I alter the above code to account for that?
------------------------------
Mike Tamoush
------------------------------
One of my related fields uses the record ID for key, and is numeric. The other uses a related field that is not the record ID, and is a Unique key field that is text. How would I alter the above code to account for that?
------------------------------
Mike Tamoush
------------------------------
MarkShnier__You
Qrew Legend
6 years agoMike
When specifying a record in a URL you can specify the rid or the key
&rid=
&key=
so just replace "&rid=" with "&key="
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
When specifying a record in a URL you can specify the rid or the key
&rid=
&key=
so just replace "&rid=" with "&key="
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- MichaelTamoush6 years agoQrew CaptainGotcha - I didn't actually even make it that far, the second line creates var number except one of my related fields is non numeric. I get an error says it is expecting numeric but receiving text
------------------------------
Mike Tamoush
------------------------------- MarkShnier__You6 years ago
Qrew Legend
.. not sure if that is a question, but if so we would need to see the formula and the error message
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------- BrandonDrake6 years agoQrew CadetHi Mike,
I think that all you would need to do is move the if statement to get the record ID from the variable and put it directly in the URL variable. This way, you will be able to place any data type in the formula. The issue is with declaring a variable, it can only be one data type, but if you put it in the URL you will not need to declare a specific type.
var text URL = URLRoot() & "db/" & $tableID & "?a=dr&key=" & URLEncode(if([Condition to select parts or pieces] = true, [Related Parts], [Related Pieces]));
It is a good practice to URLEncode() your field if you have a primary key that is not the default numeric record ID just to ensure that if the primary key has any special characters you will not throw an error.
Let me know if this works.
------------------------------
Brandon Drake
JHI Group
Monroeville OH
------------------------------