yes, that code above is the general template
var text CopyMasterDetail = URLRoot() & "db/" & Dbid() & "?a=API_CopyMasterDetail&destrid=0&sourcerid=" & ToText([Record ID#])
& "&apptoken=" // if you have app tokens enable, put it in here
& "©fid=6" // replace the 6 insert the fid for the invoice# field here
& "&relfids=7"; // replace the 7 with the fid for the report link field on the relationships between invoice and lines
The help for the URL parameters is here
https://help.quickbase.com/api-guide/#API_CopyMasterDetail.htmWhen you run an API, when it fails it will spew back on the screen error messages and when it succeeds, it will also spew back on the screen with a success message.
So once you get it working, then you will need to have what is called a redirect to land the user somewhere or else the user will be exposed to the success message which they will think is an error message.
The format for that is
$CopyMasterDetail
& "&rdr=" & URLEncode(urlroot() & "db/" & .... the rest of the URL where you want to land the user).