Forum Discussion

TauryAnderson2's avatar
TauryAnderson2
Qrew Trainee
6 years ago

Create ""Save"" button that saves the record and then displays record in view mode

I want to create a simple "Save" button which saves the new record and then displays it in view mode.  Their doesn't seem to be an API command that does this.  This must be super simple, but I am not strong in the "code department.

16 Replies

  • this code as a formula Rich text field will make an extra save button to put on your form.

    "<a id='saveButton' class='Vibrant Success' onclick='DoSave()' href='#'>WhatEverYouWantYourButtonToSay</a>"

    The colors can be controlled by the words. Ignore the formula, I'm just showing you the colors available.  But I think that the success which used to be green got turned into blue when we had the purple day rebranding at Quick Base a few months ago.



    List("&nbsp;",
        "<a class='Vibrant'>Vibrant</a>", // regular grey button
        "<a class='Vibrant Alert'>Vibrant Alert</a>", // yellowish
        "<a class='Vibrant Danger'>Vibrant Danger</a>",  // red
        "<a class='Vibrant Primary'>Vibrant Primary</a>", // blue
        "<a class='Vibrant Snowy'>Vibrant Snowy</a>",  // white
        "<a class='Vibrant Success'>Vibrant Success</a>" // green


  • Thank you!  Works like a charm.  Now, what if I want to end up at the "view" mode of the record I just saved?
  • I don't understand. is the issue that you are landing back on a report after adding a record. Where are you landing that is a problem.  Where are you launching the Add Record from?
  • I am launching the "Add Record" from a Parent table (Properties) URL button to create the new child record "Work Order". 
    In "Work Order, I have placed my new save button. 
    When I click the new save button, I want to end up looking at the record that I just saved (rather than the Parent record from which it was created)

  • The fix is to change your ad child button. Can you post your code for at child and I�ll show you how to fix it.
    • TauryAnderson2's avatar
      TauryAnderson2
      Qrew Trainee
      URLRoot() & "db/" & [_DBID_WORK_ORDERS] & "?a=API_GenAddRecordForm&_fid_20=" & URLEncode ([Record ID#])& "&_fid_44=" & URLEncode([Address Code]) & "&z=" & Rurl()
      &"&_fid_236="& URLEncode(1)

    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      No problem, just get rid of this.

      & "&z=" & Rurl()

      That will allow you to stick the landing like in gymnastics and stay right on the record that you just saved.
    • TauryAnderson2's avatar
      TauryAnderson2
      Qrew Trainee
      Yay!  works perfectly!  Okay, one more question and then I swear I am done - how do I use this button to ALSO change a field in the record I am about to save?  I have a fid #248 called "Type" which needs to be changed to the contain the text "Estimate" before the Save occurs.
  • SuryaExpert's avatar
    SuryaExpert
    Qrew Assistant Captain

    Tarury, What you described is the default behavior of the add new record button that you see on the table home page. The URL behind it is db/<dbid>?a=nwr


    This is designed to save the new record and then open it in view mode.
  • Tauray

    Are you launching off a parent record to add a child or are you launching off the dashboard?
  • I am not launching off the dashboard - it must be created from the parent record.