Forum Discussion

IanGrant's avatar
IanGrant
Qrew Trainee
2 hours ago
Solved

Trouble with URL button to copy a record with custom GUID (key) field

Hi, I'm trying to create a button that will allow users to copy a record but I'm using my own key field so I need to increment that automatically in the process. Context: We have an online form for...
  • MarkShnier__You's avatar
    2 hours ago

    Unfortunately, the a=GenCopyRecord function does not allow you to specify values for any fields. It simply puts you into the Add record mode with fields copying forward where the field is flagged to copy forward on the field properties settings.  

    But instead, you could use this syntax

    URLRoot() & "db/" & dbid() &  "?act=API_GenAddRecordForm"

    & "&_fid_6=" & URLEncode([SDO Request GUID]&"-"&ToText([Record ID#]))

    & "&_fid_7=" & URLEncode([my field in field 7])

    & "&_fid_8=" & URLEncode([my field in field 8])

    & "&_fid_9=" & URLEncode([my field in field 9])

     

    .. So this is pretty easy to do except that you do have to specify every single field to be copied forward.