Forum Discussion
ChrisFaye1
5 years agoQrew Cadet
Thank You, Mark! I was hoping it could be combined!
Are you able to add values to the GenCopyRecord action?
Example:
var URLTWO = URLRoot() & "db/" & dbid() & "?a=GenCopyRecord&rid=" & [Record ID#]
& "&_fid_2046=true";
Finally does this auto-save the record or bring the user into the newly copied record/pending the creation-save? If it brings you into the new record would I need to remove the location reload instruction below?
var text URL =
"javascript:" &
"$.get('" &
$URLONE
& "&rdr=" & URLEncode($URLTWO)
&
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);";
Thank You Thank You!
------------------------------
Chris
------------------------------
Are you able to add values to the GenCopyRecord action?
Example:
var URLTWO = URLRoot() & "db/" & dbid() & "?a=GenCopyRecord&rid=" & [Record ID#]
& "&_fid_2046=true";
Finally does this auto-save the record or bring the user into the newly copied record/pending the creation-save? If it brings you into the new record would I need to remove the location reload instruction below?
var text URL =
"javascript:" &
"$.get('" &
$URLONE
& "&rdr=" & URLEncode($URLTWO)
&
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);";
Thank You Thank You!
------------------------------
Chris
------------------------------
BlakeHarrison
5 years agoQrew Captain
For what you're trying to accomplish - landing in Edit on a Copied Record - you don't need to reload the screen. Your user will land on the initial creation of that Copy action. Also, Quickbase just posted a big announcement regarding the use of JS in buttons, so I'd suggest you go read up on that. Most in-button JS will be limited in the coming months.
------------------------------
Blake Harrison
bharrison@datablender.io
DataBlender - Quickbase Solution Provider
Atlanta GA
404.800.1702 / http://datablender.io/
------------------------------
------------------------------
Blake Harrison
bharrison@datablender.io
DataBlender - Quickbase Solution Provider
Atlanta GA
404.800.1702 / http://datablender.io/
------------------------------
- MarkShnier__You5 years ago
Qrew Legend
=Chris
this will not work
var URLTWO = URLRoot() & "db/" & dbid() & "?a=GenCopyRecord&rid=" & [Record ID#]
& "&_fid_2046=true";
If you really need to do that then you need to use
var URLTWO = URLRoot() & "db/" & dbid() & "?a=GenAddRecrdForm
& "&_fid_10=" & urlencode([field 1])
& "&_fid_11=" & urlencode([field 2])
etc
so you will need to specify every field to load into the form.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------ - ChrisFaye15 years agoQrew CadetThanks for confirming, Mark! I was thinking that I think we should be able to stick with having our team make the updates in the copied record rather than listing out all the copied fields.
Thanks for sharing that update, Blake! I hadn't seen that yet. 😬
Clearly some big changes going on in-house, totally get the security aspect, but didn't QB used to claim to be a low code tool vs. no code? ​Also, rather than focusing on this, it'd be nice if they stopped forcing unfinished updates like these beta reports that don't work and pretending like the exec dashboard is coming out soon... Sorry... just venting now... smh
------------------------------
Chris
------------------------------ - ChrisFaye15 years agoQrew CadetSorry, Mark, final question.
How would I close out the script properly to allow it to open the newly copied record?
Here's what I have currently, but I'm not sure how to remove the reload line. I've tried a few things like updating to reload(false), but that doesn't seem to be executing the copy record let alone bringing me into the new record.
Thank You!
var text URL =
"javascript:" &
"$.get('" &
$URLONE
& "&rdr=" & URLEncode($URLTWO)
&
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);";
------------------------------
Chris
------------------------------ - MarkShnier__You5 years ago
Qrew Legend
Chris,
There is no fancy javascript required here.
You will land on an add record form and save and stick on that record. Unless you want to land somewhere else after saving.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------ - ChrisFaye15 years agoQrew CadetGood Morning and Thank You, Mark!
Here's the code I'm using, but it's not allowing me to save. Do I need to close out the string or something? Are you seeing anything missing or incorrect?
Thank You!
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_2042=" & URLEncode(UserToName(User()))
& "&_fid_2043=true"
& "&_fid_627=false"
& "&_fid_236=" & "Transfer"
& "&apptoken=________________";
var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=GenCopyRecord&rid=" & [Record ID#];
$URLONE
& "&rdr=" & URLEncode($URLTWO)
If([Status]="Transfer",
"<a class='Vibrant Danger'>Transferred</a>",
"<a class='Vibrant Alert' style='border:1px solid #6BBD57; background-color:#47368B'" & "a href=" & $URL & ">Transfer</a>")
------------------------------
Chris
------------------------------ - ChrisFaye15 years agoQrew CadetNever mind... I figured it out... Just being dumn...
Posting in case it's helpful for anyone.
Thanks Again for all your help, Mark!
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_2042=" & URLEncode(UserToName(User()))
& "&_fid_2043=true"
& "&_fid_627=false"
& "&_fid_236=" & "Transfer"
& "&apptoken=_______________";
var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=GenCopyRecord&rid=" & [Record ID#];
var text URL =
$URLONE
& "&rdr=" & URLEncode($URLTWO);
If([Status]="Transfer",
"<a class='Vibrant Danger'>Transferred</a>",
"<a class='Vibrant Alert' style='border:1px solid #6BBD57; background-color:#47368B'" & "a href=" & $URL & ">Transfer</a>")
------------------------------
Chris
------------------------------ - MarkShnier__You5 years ago
Qrew Legend
try this
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_2042=" & URLEncode(UserToName(User()))
& "&_fid_2043=true"
& "&_fid_627=false"
& "&_fid_236=" & "Transfer"
& "&apptoken=________________";
var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=GenCopyRecord&rid=" & [Record ID#];
var text URL =
$URLONE
& "&rdr=" & URLEncode($URLTWO);
If([Status]="Transfer",
"<a class='Vibrant Danger'>Transferred</a>",
"<a class='Vibrant Alert' style='border:1px solid #6BBD57; background-color:#47368B'" & "a href=" & $URL & ">Transfer</a>")
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------