Discussions

Expand all | Collapse all

Create a button that saves the current record and adds a new record to the same table

Kelly Kelly04-11-2018 11:59

QuickBaseCoach Dev./Training04-11-2018 15:18

  • 1.  Create a button that saves the current record and adds a new record to the same table

    Posted 08-07-2017 22:49
    In this application users need to add multiple records containing some similar values. In order to prevent them from having to enter the same information again and again on each record they create, I would like to give them a button that:

    1. saves the current new record AND
    2. initiates the adding of a new record with the fields that contain repeated information already populated.

    The native "Save and add new" functionality accomplishes #1 above, but not #2. When using this native functionality, the user still needs to enter ALL of the information manually.

    So far I've created a button labeled "Save and add another" which works great (except for the annoying prompt to "Save" the record before moving on) when the user clicks it for each subsequent record they need to create.  The current record gets saved, and a new record is initiated with the repeated information auto-populating. Great! However, when they get to the last record and they use the native "Save and close" button, they get this nasty error:

    "Record not found. It has probably been deleted. If you followed a link to get here, you may want to inform the author of that link that this record no longer exists." I'm not sure why this is happening.

    Any thoughts on how to fix this?


  • 2.  RE: Create a button that saves the current record and adds a new record to the same table

    Posted 08-07-2017 23:40
    Well, I came up with an alternative solution to what I was looking for.

    I created a separate button labeled "Save and Done." All this button does is (after prompting the user to save) open the last added record in view mode. 

    Not ideal, but no nasty errors so I'll take it.

    Now if I could only figure out how to add the code to save the record without that annoying prompt, that would make my day.

    Cheers!


  • 3.  RE: Create a button that saves the current record and adds a new record to the same table

    Posted 08-08-2017 01:02
    The Native functionality under the More button to Add Similar, will carry forward any data from a a saved record in fields where the field property is checked to copy the value forward, which is the default behaviour.

    The record, however, must be saved first.

    If you want to make a URL formula button to replicate thus functionality so the users do not need to look for the More button you can use this Syntax.

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


  • 4.  RE: Create a button that saves the current record and adds a new record to the same table

    Bronze
    Contributor
    Posted 04-11-2018 05:52
    The same thing is happening to me, but I am not using the More Button. I am trying to add a child record, and for some reason, it will not allow me to save and then view the record. The "az=" takes me to a new record, and now this code (below) is generating the error described above. I don't understand, because I use it successfully on another form:

    URLRoot() & "db/" & [_DBID_CUSTOMER_REPS] & "?a=API_GenAddRecordForm&_fid_26=" & ([Account #]) & "&dfid=10" & "&z=" & Rurl()

    Despite the error, the record does safe with the child record.


  • 5.  RE: Create a button that saves the current record and adds a new record to the same table

    Silver
    Contributor
    Posted 04-11-2018 12:00
    Hi Kelly,

    Is [Account #] field your key field in the parent table?

    Thanks,

    Gaurav


  • 6.  RE: Create a button that saves the current record and adds a new record to the same table

    Bronze
    Contributor
    Posted 04-11-2018 12:01
    Yes, it is.


  • 7.  RE: Create a button that saves the current record and adds a new record to the same table

    Posted 04-11-2018 10:13
    It is not clear what your question is and where this button code has been placed.


    The suffix of & "&z=" & Rurl()


    Causes the user to be returned to the Record they were on when they pushed the button.


    If you want to stick on viewing the newly created record, remove that code.


  • 8.  RE: Create a button that saves the current record and adds a new record to the same table

    Bronze
    Contributor
    Posted 04-11-2018 11:30
    I have a parent record and a child record. I want to Add a Child Record, and when I save it, I want to go back to the Parent Record in which I created it from. It works in another table. In this one, I am getting an error that says that it can't locate the record - despite the fact that it just saved both records. I don't know why it's going to this error page. 


  • 9.  RE: Create a button that saves the current record and adds a new record to the same table

    Posted 04-11-2018 11:55
    Is the parent record saved when you hit the button?  Did you set the advanced properties of the Parent table to save automatically when a child record is created.

    Advanced Table Settings

     Save parent record automatically when a child record is created. Learn more


  • 10.  RE: Create a button that saves the current record and adds a new record to the same table

    Bronze
    Contributor
    Posted 04-11-2018 11:59
    Yes, I did.


  • 11.  RE: Create a button that saves the current record and adds a new record to the same table

    Bronze
    Contributor
    Posted 04-11-2018 14:20
    Here are a couple screenshots to give you some perspective...

    1. You can see that the Account is there. The parent record was saved.

    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1724089/RackMultipart20180411-15343-1jauhhj-Screen_Shot_2018-04-11_at_10.17.00_AM_inline.png?1523456324">

    2. You see that the Customer Rep was saved to the Parent Record. I have verified that these records do exist and are connected in the database. However, I still get this error...



  • 12.  RE: Create a button that saves the current record and adds a new record to the same table

    Posted 04-11-2018 14:48
    Well that is a puzzler for sure.  I happen to be down in Boston at Quick Base right now for QSP meetings, so I can't engage with you one on one right now.  Maybe contact me off line via the info in my website QuickBaseCoach.com and I will set up a quick one on one at no cost to see what the problem could be.  Or else put in a support ticket to Quick Base Support.


  • 13.  RE: Create a button that saves the current record and adds a new record to the same table

    Bronze
    Contributor
    Posted 04-11-2018 15:15
    My only theory is that this is a form that is open to everyone on the Internet. It is a parent record only. I have another form that is open to everyone on the Internet but made up of 2 child tables. Could that be it?


  • 14.  RE: Create a button that saves the current record and adds a new record to the same table

    Posted 04-11-2018 15:18
    Does it work if you remove the form override.

    �&dfid=10


  • 15.  RE: Create a button that saves the current record and adds a new record to the same table

    Bronze
    Contributor
    Posted 04-11-2018 15:25
    No, but when I do that it doesn't acknowledge the parent relationship. The account name doesn't display.