Forum Discussion

LashellThomas's avatar
LashellThomas
Qrew Member
3 years ago

How to create a new record button in a form to another table

How can add a "new record" button to another table with a form and have it populate a certain field from the from?

So passing along the right value through the button url into the form?

------------------------------
Lashell Thomas
------------------------------

3 Replies

  • The generic format would be like this assuming that the other table is in the same app.

    URLRoot() & "db/" & [_DBID_of the other table from advanced properties]
    & "&_fid_10=" & URLEncode([field 1])
    & "&_fid_11=" & URLEncode([field 2])
    & "&_fid_12=" & URLEncode([field 1])

    // this last line is optional and will cause the user to land on the record or report they started form when clicking as opposed to the newly created record.
    & "&z=" & Rurl()

    The URLEncode is required when the value being put into the URL might have any characters which are not A-Z or 0-9, as some of them don't travel through the magic of the internet.  For example URL do not ever have spaces.

    It a best practice to refer to the target table by its table alias from Advanced Properties of the table.  That way if you copy the app it will still work.  If its going to be a cross app ADD button then you will need to hard code the table code.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • LashellThomas's avatar
      LashellThomas
      Qrew Member

      The table is another app...

       

      How would it change this guidance.

       

      Lashell

       

       

       



      NOTICE TO RECIPIENT OF INFORMATION:

      This e-mail may contain confidential or privileged information. If you think you have received this e-mail in error, please advise the sender by reply e-mail and then delete this e-mail immediately.

      This e-mail may also contain protected health information (PHI) with information about sensitive medical conditions, including, but not limited to, treatment for substance use disorders, behavioral health, HIV/AIDS, or pregnancy. This type of information may be protected by various federal and/or state laws which prohibit any further disclosure without the express written consent of the person to whom it pertains or as otherwise permitted by law. Any unauthorized further disclosure may be considered a violation of federal and/or state law. A general authorization for the release of medical or other information may NOT be sufficient consent for release of this type of information.

      Thank you, Aetna



      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        URLRoot() & "db/" & "xxxxxxxxxxx"
        & "&_fid_10=" & URLEncode([field 1])
        & "&_fid_11=" & URLEncode([field 2])
        & "&_fid_12=" & URLEncode([field 1])

        // this last line is optional and will cause the user to land on the record or report they started form when clicking as opposed to the newly created record.
        & "&z=" & Rurl()


        // xxxxxxx would be the table id code that you see in the url when on the target table.


        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------