I have created a Copy Master detail records button.....I have Table A (Parent) and Table B (Child)......I would like to copy a Table A Record with its related Table B child records.....When I click the [Copy Master detail records] I get an error issue:
"CopyMasterDetails" does not allow unique fields.
I assume this is due to the fact that I'm not using Quickbase's standard [RecordID] as my key field within Table A....I have a [text] field as my key field..and I guess when I click [Copy Master detail records]....quickbase is trying to copy my key field (which must be unique) into the new Parent record....
Any suggestions on how to overcome? Thanks
Alternatively you can use the API AddRecord and have a long URL formula to specify each field to be copied over.
Then you would need to the Copy Master detail URL to import the child records from one record to another. I happen to be doing a project now that may require me to do those same steps due to a mysterious problem where the usual Copy Master Detail API is not working. The trick will be to find an elegant way to specify the Parent record for who's children should be copied in. I think I know what approach i will use - if you like you can contract me via the information in my Profile and when I get it working maybe over the weekend, I can show you want I did.
You can lookup the help into on the API to Copy Master detail here http://www.quickbase.com/user-assistance/Default.html#apicalls.html and look down the list for Copy Master Detail. Then you can read the parameters and then skip down to the URL format at the bottom.
So, you you would do a lookup to get the Parents whose records are to be copied to be a lookuop field onto the record.
Then the formula (not tested) would be
var text URLONE =
URLRoot() & "db/" & dbid() & "?act=API_CopyMasterDetail"
& "&Destrid=" & ToText([Record ID#]) // ie the target to copy to is the Record ID I'm sitting on now
& "&Sourcerid=" & ToText([Record ID# of the Source Parent])
& "&refilds=41"; // the number 41 gets replaced with the field ID of the Report Link field on the right side of the relationship for the child table records to be copied in.
var text URLTWO=
urlroot() & "db/" & dbid() & "?a=dr&rid=" & ToText ([Record ID#]);
& "&rdr=" & URLEncode($URLTWO)
I really appreciate your help. I was not able to get it working......I got the error below.....
This XML file does not appear to have any style information associated with it. The document tree is shown below.
CopyMasterDetail does not allow looping relationships
There is an alternative to have the user select a Parent record and then be able to copy from that selected Parent into another record, but the method is too complicated to explain on this forum, and would take me about an hour of consulting time to get working for you. I suggest that you contact me off line via the information in my profile if you want to talk about that.
[SourceRecord ID#] -- via look-up
'bkyu9yauw' = tableURLid