Discussions

 View Only
  • 1.  Add Child Record from Gen Add Record Form and View Child Record

    Posted 03-30-2018 13:43
    Hello,

    I have a process where users will add a new record and then from that add record form they need to be able to add a child record and have that parent record ID be related to that child record.  Once they save the child record it should show the child record in view mode.  As of right now it returns to the parent record in edit mode.

    My questions are:
    1.  How do I pass the related parent record id to the child record from an add record screen?
    2. How do I view the child record after saving the child record?

    Thanks all!


  • 2.  RE: Add Child Record from Gen Add Record Form and View Child Record

    Posted 03-30-2018 14:00
    I think that this is low tech.

    Go to the settings for the Parent table, Advanced Settings and check the box for

    "Save Parent record automatically when a child record is added."

    Then the default behaviour will be to return to the Parent record after saving the Child.

    If you want to stick on view mode on the child after saving, then edit the Add Child code to comment out or remove that last part which says 

    & "&z=" & Rurl()


  • 3.  RE: Add Child Record from Gen Add Record Form and View Child Record

    Posted 03-30-2018 14:04
    ie you can be in Add mode and Add Child and the Parent record will save automatically and the child will automatically connect to the Parent.


  • 4.  RE: Add Child Record from Gen Add Record Form and View Child Record

    Posted 06-13-2018 06:29
    Mark, my child record saves and returns back to the parent, but in edit mode. I can't seem to make it go back in display mode. Here is my code:

    URLRoot() & "db/" & [_DBID_RUN__REQUESTS] & "?a=API_GenAddRecordForm&dfid=11&_fid_12=" & ([Tracking#]) & "&rdr="& "&z=" & Rurl()


  • 5.  RE: Add Child Record from Gen Add Record Form and View Child Record

    Posted 06-13-2018 11:12
    I don't know of a way to return the user to the parent record in View mode.  It return you to the Parent record in the state it was in when you left it, which was edit mode (well, actually add mode), but in a typical situation the User is working their way  down a long form and filling in fields and adding children record as they go.  ie there could be multiple child tales they are completing as they work their way though the parent form.

    If you want to ensure that the user is returned the the Parent record in View mode, then the add child button would need to be clicked in view mode, so you would need to suppress the Add Child button from appearing in edit or add modes on the form.


  • 6.  RE: Add Child Record from Gen Add Record Form and View Child Record

    Posted 06-13-2018 12:12
    Well that makes sense! I can't believe I didn't realize that... Thank you!