Forum Discussion

ArchiveUser's avatar
ArchiveUser
Qrew Captain
7 years ago

Add a new record but stay on the same same form

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()
  • 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#])
    • ArchiveUser's avatar
      ArchiveUser
      Qrew Captain
      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.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      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?
    • ArchiveUser's avatar
      ArchiveUser
      Qrew Captain
      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.
  • 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.
    • ArchiveUser's avatar
      ArchiveUser
      Qrew Captain
      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>
    • EstherGrandal_D's avatar
      EstherGrandal_D
      Qrew Cadet
      I think there is not error , you already created the record in the other table.
    • EstherGrandal_D's avatar
      EstherGrandal_D
      Qrew Cadet
      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)