Forum Discussion

ZintJoseph's avatar
ZintJoseph
Qrew Captain
8 years ago

Formula text button to create Quick Base Action (Add Record) and redirect to that record

I have a formula text button in a table to check a box in one table, fire an Action to create a new record in another table. Right now the formula takes me back to the original table. I need to go to the record in the new table.
  • I suspect that will be impossible as to redirect to that newly created record, you would need to know the Record ID,  and that is not know at the time the button is pushed.

    One solution would be to redirect the user to a report of records created just now (in that table of records that the Action created).  So a report sorted by date created, newest on the top and created in the last minute.

    I was going to suggest a report of records a "I" created today by the current user, but I think that the [Record Owner], unfortunately is the Action Owner and not the Current user.

    So basically land the user on a report where the top record on the report is likely the one that just was created.
  • Why not just bind a script to your button and use some simple JavaScript to call API_AddRecord and redirect to precisely the URL you want? The features that QuickBase has added (I am looking at you actions) perform a specific task but in a hardcoded way and don't have any extra configuration if you don't see a control in the graphical interface. 

    Just go all in on using script any these and other obstacles evaporate.
  • Hi Dan, can you maybe supply me with an example of your statement above, as I am trying to do exactly the same?
  • Paul,can you explain what you are trying to do?  Maybe there is a non script solution.  If you use a regular API to API_AddRecord and suffix it with &disprec=1 then it will land the use on the newly created record.
    • JuanSolorio1's avatar
      JuanSolorio1
      Qrew Cadet
      Hi Mark,

      I am trying to use this solution to open the newly created record in edit mode instead of view mode. Do you know how to go about doing that?

      Thanks in advance!

      ------------------------------
      Juan Solorio
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        @Juan C Solorio
        Are you asking how to make a button which will create a record and land the user on the newly created record in edit mode?  Like API_AddRecord and land the user on the record in edit mode? ​

        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------
  • Hi Mark, thank you for responding swiftly...I am in the process of developing a Customer Call Centre and the the call centre agent needs to Verify the Customer Details as "Passed" or "Failed".  The trick of these two buttons are, the record hasn't been created yet.  I have managed to get "Passed" working, by using the "SaveAndNextTab.js" provided by Alex Wilkinson (https://community.quickbase.com/quickbase/topics/how-do-i-create-a-button-that-allows-the-user-to-continue-to-the-next-tab).  I am now struggling to configure the "Failed" button, because it doesn't go to the next tab, but it goes to a different tab or different form.  I hope this makes sense...in essence I need to register the record, update the checkbox for "Failed" and move to a tab or a form to provide comments for Failure.  As I have realised, you need to run two separate calls, 1. Creating the Record, and 2. redirecting to the Tab/Form (I know you have provided a solution to go back to a report, but unfortunately the call centre agents works against time, and they need to click on a new tab or form).  I am willing to share my app as well, if you want to look at the code? 
  • I have now tried your suggestion, and the code looks as follows:
    "<a  class='Vibrant Success' href='" & "bnhjm55g9" & "?a=API_AddRecord&apptoken=b5grgfsu68y86brzbpwkdybed6z&_fid_2=" & [Record ID#] & "&disprec=1" &  "'>Make an Enquiry</a>"

    1. It creates the record, and refresh the screen, but the data fields are empty. I would need to add the checkbox update to it and populate the data? or redirect to another form? 
  • What fields are you trying to populate?

    and what's going on here

    &_fid_2=" & [Record ID#] 

    You cannot populate data into fid 2 as that is a built in field which is not updatable.


    the idea is to line up the fields you want to populate like

    & "&_fid_12=" & urlencode("something into fid  12")
    & "&_fid_13=1" // set fid 13 to be true (checked)