Forum Discussion
HarrisonSmith
5 years agoQrew Trainee
Downloaded, and the formulas you have there make sense. The part I'm stuck on is how to populate the fields dynamically based on which child record the button is clicked from. In your examples, the field values are hard-coded ("PO Line Approved"}. Or maybe I'm just missing something obvious.
------------------------------
Harrison Smith
------------------------------
------------------------------
Harrison Smith
------------------------------
MarkShnier__You
Qrew Legend
5 years agoOK, here is another example
var text ClockPunch = URLRoot() & "db/" & [_DBID_TIME_PUNCH] & "?act=API_ADDRecord"
& "&apptoken=xxxxxxxxxxxx"
& "&_fid_17=" & URLEncode([Field 1])
& "&_fid_81=" & URLEncode([Field 2]);
var text ReturnToEmployeeClockForm= URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];
$ClockPunch
& "&rdr=" & URLEncode($ReturnToEmployeeClockForm)
// in this example i am putting the values from Field 1 into field ID 17.
// if you have Application Tokens enabled, the you will also need to include that line
// if the data you are putting into any of the fields might have spaces or special characters, then you should URLEncode them or it might fail. You are creating a URL click which needs to travel though the mysteries of the internet and the internet does not like spaces or special characters in URLs.
if your formula does not work, please post an editable copy and paste the code and not a screen shot of the code.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
var text ClockPunch = URLRoot() & "db/" & [_DBID_TIME_PUNCH] & "?act=API_ADDRecord"
& "&apptoken=xxxxxxxxxxxx"
& "&_fid_17=" & URLEncode([Field 1])
& "&_fid_81=" & URLEncode([Field 2]);
var text ReturnToEmployeeClockForm= URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];
$ClockPunch
& "&rdr=" & URLEncode($ReturnToEmployeeClockForm)
// in this example i am putting the values from Field 1 into field ID 17.
// if you have Application Tokens enabled, the you will also need to include that line
// if the data you are putting into any of the fields might have spaces or special characters, then you should URLEncode them or it might fail. You are creating a URL click which needs to travel though the mysteries of the internet and the internet does not like spaces or special characters in URLs.
if your formula does not work, please post an editable copy and paste the code and not a screen shot of the code.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- HarrisonSmith5 years agoQrew TraineeAh perfect, thank you! Must be slow on a Friday, I forgot you could just list the field within the parentheses of the URLEncode function.
------------------------------
Harrison Smith
------------------------------- MarkShnier__You5 years ago
Qrew Legend
OK. We will have you being a URL formula ninja in no time at all. So you just continue to list the fields that you want to populate and I like to list them vertically so I get the syntax correct.
For that one field that you do not want to populate you just did not populate it.
I should also point out that there is a different syntax if you want to land the user on a new record form in ADD record mode and copy the fields forward from whatever record you launched off of. So in that case you were not actually creating a record but putting up an ADD record form with fields pre-populated.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------- HarrisonSmith5 years agoQrew TraineeHey Mark, I'm having a different issue with process. Some of the fields I'm trying to copy over to a new record are lookup reference fields, but the formula I've built isn't populating those at all. Is this just a fault in QB that lookup fields can't be copied to new records, or am I missing something? Below is my formula field. The fields that aren't populating are: Related Matter, related phase, & related task
//Create new Timer record & populate fields with values from Timer record button was clicked on
var text AddTimer =
URLRoot() & "db/" & Dbid() & "?a=API_AddRecord" &
"&apptoken=xxxxxxxxxxxxxxxxxxxxxxxx" &
"&_fid_6=" & URLEncode([Related Matter]) &
"&_fid_7=" & URLEncode([Matter - Case Name]) &
"&_fid_8=" & URLEncode([Description]) &
"&_fid_10=" & URLEncode("") &
"&_fid_60=" & URLEncode([Related Phase]) &
"&_fid_62=" & URLEncode([Related Task]) &
"&_fid_76=" & URLEncode([Category]);
//Redirect back to display the Parent Matter Record
var text Redirect =
URLRoot() & "db/" & [_DBID_PROJECTS]
& "?a=dr&rid=" & ToText([Related Matter]);
$AddTimer & "&rdr=" & URLEncode($ReDirect)
------------------------------
Harrison Smith
------------------------------