Forum Discussion
- QuickBaseCoachDQrew CaptainMick,
There is help in the API guide but basically you need to convert this to an a formula URL using an the CopyMasterDetail API, and then you can do successive actions. ie do the copy and then redirect to show the dashboard.
So it would be like
var text URLONE = urlroot() & "db/" & [_DBID_of the Parent table] & "?act=API_CopyMasterDetail&recurse=false&sourceRID=463&relfids=510";
var text URLTwo = and here you need to hard code the main URL of the app.
var text URLTWO = "https://mycompany.quickbase.com/db/abcdefg;
$URLONE
& "&rdr=" & URLEncode($URLTWO) - MichaelGraham2Qrew Assistant CaptainIm getting the following when trying to save the formula url field?
The argument list of the function rdr must begin with a left parenthesis.
var text URLONE = urlroot() & "db/" & [_DBID_PROPERTIES] & "?act=API_CopyMasterDetail&recurse=false&sourceRID=463&relfids=510";
var text URLTWO = "https://xxxxx.quickbase.com/db/xxxxxxxxx?a=showpage&pageid=30;
$URLONE
& "&rdr=" & URLEncode($URLTWO) - MichaelGraham2Qrew Assistant Captainah, it needed a " after the 30
But now its asking for apptoken. Ive created one but I dont think I have it in the right place...
var text URLONE = URLRoot() & "db/" & [_DBID_PROPERTIES] & "?act=API_CopyMasterDetail&recurse=false&sourceRID=463&relfids=510"&apptoken=apptoken; - QuickBaseCoachDQrew Captainvar text URLONE = URLRoot() & "db/" & [_DBID_PROPERTIES] & "?act=API_CopyMasterDetail&recurse=false&sourceRID=463&relfids=510&apptoken=apptoken";
- MichaelGraham2Qrew Assistant CaptainI had tried that as well but get this:
<qdbapi>
<action>API_CopyMasterDetail</action>
<errcode>2</errcode>
<errtext>Invalid input</errtext>
<errdetail>CopyFID required</errdetail>
</qdbapi - QuickBaseCoachDQrew Captaintry this change
var text URLONE = URLRoot() & "db/" & [_DBID_PROPERTIES] & "?act=API_CopyMasterDetail&recurse=false&sourceRID=463&destrid=" & [Record ID#] & "&relfids=510&apptoken=apptoken"; - MichaelGraham2Qrew Assistant CaptainSorry Mark, I have been away... just tested that and it works a real treat... THANKS!
- QuickBaseCoachDQrew CaptainGreat. Thx for letting me know.
- GauravSharma3Qrew CommanderHi Mark,
While creating child records, I also want to set some defaults value with this API call. I tried but could not succeed.
Here is my formula:
URLRoot() & "db/" & Dbid() & "?a=API_CopyMasterDetail&sourceRID=1&destrid=" & [Record ID#] & "&relfids=684"
& "&_fid_76=" & "Not Required"
& "&_fid_77=" & "Not Required"
& "&_fid_78=" & "Not Required"
& "&_fid_79=" & "Not Required"
& "&_fid_80=" & "Not Required"
& "&_fid_81=" & "Not Required"
& "&_fid_82=" & "Not Required"
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Thanks,
Gaurav Sharma - QuickBaseCoachDQrew CaptainYou cannot change field values with the CopyMasterDetail API. Its also not obvious to get at the rid for the newly created record.
What I do is to land the user on a report of recently created Parent records by the current user. ie the records you just created. I do that with an rdr after the copymasterdetail.
I then detect that the name field for the record now begins with "copy of", and show a button and a big red message asking the user to put the button. The button then makes any field changes required.- _anomDiebolt_Qrew EliteMS> You cannot ...
Here is my advice: If you have an rdr parameter in your formula URL you should be using script instead for the entire feature. - GauravSharma3Qrew CommanderDan, what is that script?
Thanks,
Gaurav - GauravSharma3Qrew Commanderor can we use API_Editrecord with the CopyMasterDetail API?