Forum Discussion

Re: Copy Record Action in Rich Text Button

Hi Chris,

I am not certain if you can pack all those steps into a single button. We have only been able to get one edit/add record and then reload or redirect using the UrlOne & UrlTwo trick.

I can see a button that does this:
1. edit the record (add a field archive cxbx make it true as part of er)
save the record

2. Webhook triggers off modified records where archive cxbx = true
copy the old record [rid step 1] to a new record

Update your reports to hide records where archive  = true.

Sounds like an infinitely collapsing log table.

Jim

------------------------------
Jim Harrison
transparency = knowledge + understanding : The Scrum Dudes
------------------------------

10 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Icon for Qrew Legend rankQrew Legend
    Chris,
    The edit will need to be first and then the GenAddRecordForm copy.

    var text URLONE = URLRoot() & "db/" & Dbid()

    & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_2044=" & URLEncode(UserToName(User()))
    & "&_fid_2046=true"
    & "&_fid_627=false"
    & "&apptoken=******";

    var URLTWO = URLRoot() & "db/" & dbid() & "?a=GenCopyRecord&rid=" & [Record ID#];

    $URLONE
    & "&rdr=" & URLEncode($URLTWO)


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • ChrisFaye1's avatar
      ChrisFaye1
      Qrew 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
      ------------------------------
      • BlakeHarrison's avatar
        BlakeHarrison
        Qrew 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/
        ------------------------------