Forum Discussion

HakimS's avatar
HakimS
Qrew Member
4 years ago

Save and Display Record

Hello!

I created a formula URL button that saves the record, but after saving, it displays the "User Not Found" Message. How can I show the record in view mode after it has been saved?

This is the submit button code:

var text Save = URLRoot() & "db/" & Dbid() & "?act=API_AddRecord&rid=" & [Record ID#];

var text Display = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];

$Save & "&rdr=" & URLEncode($Display)



------------------------------
Hakim S
------------------------------
  • Can you explain what you are trying to do.  Why not use the native save button?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • HakimS's avatar
      HakimS
      Qrew Member
      It's a public form, so I want to show the "Submit" button and hide the native button

      ------------------------------
      Hakim S
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Typically, you do not want to allow users on a public form to actually be able to view any data on the record. That just because you don't want one member of the public to see another persons entry. If they just hacked the URL a little bit they could easily do that.
        So there are two best practices. One is to make sure that the form which is displayed in view mode just has a thank you message on it and no real data.  That is really just to prevent the mild hacking.
        But what you really want to do is to redirect the user to another page. What will happen is the record will automatically get saved which is what you were trying to accomplish with your submit button. The syntax to display a page is

        URLRoot() & "db/" & AppID() & "a=ShowPage&PageID=99"

        Create the Rich Text Page under app settings and then Pages.  Change the 99 to the ID if the Page.


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