Add a new record but stay on the same same form

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
I have two tables.  A Quality Records and a Defect/NCR/ CAR.  When creating a new Quality record, it becomes a Defect/NCR/ CAR.  I want to be able to click the button, create the Defect/NCR/ CAR but stay on the Quality Record.  

Here is the formula:

URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=API_GenAddRecordForm&_fid_345=" & URLEncode ([Record ID#])& "&z=" & Rurl()
Photo of Sarah Bunten

Sarah Bunten

  • 664 Points 500 badge 2x thumb

Posted 8 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
no problem,
Just remove that last part & "&z=" & Rurl()  and you will "stick the landing", just like in gymnastics.

URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=API_GenAddRecordForm&_fid_345=" & URLEncode ([Record ID#])
Photo of Sarah Bunten

Sarah Bunten

  • 664 Points 500 badge 2x thumb
It is taking me to the Defect/NCR/CAR table form.  I need it to create a Defect/NCR/CAR in Quality Records.  

I don't think I'm explaining it very good.   I want it to stay in the table the user is in (Quality Record Table), but to create a record in a separate table (Defect/NCR/CAR).  Currently, it opening the defect/ncr/ car record.
(Edited)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
I'm confused.  Please explain which is the Parent and which is the child and where you are at when you click Add Child and what form you want to land on when you save the child.

Are you actually trying to add a record of the same type that you are sitting on?
Photo of Sarah Bunten

Sarah Bunten

  • 664 Points 500 badge 2x thumb
The Child Table is Quality Records
The Parent Table is Defect/ NCR/ CAR.  
There was a grid edit on Quality Records that once the grid was complete (Defect/ NCR/ CAR Table),then a new record for Defect/ NCR/ CAR was created. 

I want to get away from using the grid edit.  It is too time consuming for my guys on the floor.  I created a simple form in Quality Record that when they click the button, it will create a new record in Defect/ NCR/ CAR table.  I would like one to create new Defect/ NCR/ CAR record and close.  Another to create Defect/ NCR/ CAR record and copy.  

I currently have a copy record button.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Sarah,
I'm sorry, but I still am not able to understand your issue.  If you want to book one-on-one time with me to solve this issue on a GoToMeeting screen share session, you may contact me via the information on my website QuickBaseCoach.com
Photo of Sarah Bunten

Sarah Bunten

  • 664 Points 500 badge 2x thumb
Here is my copy record:
URLRoot() & "db/" & Dbid() & "?a=GenCopyRecord&rid=" & [Record ID#]
THis copies the child record. 
Photo of Esther

Esther

  • 702 Points 500 badge 2x thumb
Try the "API_AddRecord" instead of "Api_GenAddRecordForm"

URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=API_AddRecord&_fid_345=" & URLEncode ([Record ID#])& "&z=" & Rurl()


Remember when you use this call, you must add values for all required fields in this other table or API_AddRecord returns an error.

I hope it helps.
Photo of Sarah Bunten

Sarah Bunten

  • 664 Points 500 badge 2x thumb
I get this error:
This XML file does not appear to have any style information associated with it. The document tree is shown below.

<qdbapi>
<action>API_AddRecord</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<rid>36550</rid>
<update_id>1522843734635</update_id>




</qdbapi>
Photo of Esther

Esther

  • 702 Points 500 badge 2x thumb
I think there is not error , you already created the record in the other table.
Photo of Esther

Esther

  • 702 Points 500 badge 2x thumb
This is suppose to be a "formula URL" field you select the option to display it in a button , every time you click the button you create a new record in the other table.

you can take this out ;  & "&z=" & Rurl()

(check that the field 345 is the related field. It looks like you have a lot of fields)
Photo of Sarah Bunten

Sarah Bunten

  • 664 Points 500 badge 2x thumb
I created a new test record.  
Photo of Esther

Esther

  • 702 Points 500 badge 2x thumb
I do not understand what you mind with "new test record"


You created in the table ; [_DBID_TABLE_1] a record  (Id 36550) which field 345 is equal to the "URLEncode [Record ID#]  




URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=API_AddRecord&_fid_345=" & URLEncode ([Record ID#])