Discussions

  • 1.  Save and Display Record

    Posted 22 days ago
    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
    ------------------------------


  • 2.  RE: Save and Display Record

    Posted 22 days ago
    Can you explain what you are trying to do.  Why not use the native save button?

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



  • 3.  RE: Save and Display Record

    Posted 22 days ago
    It's a public form, so I want to show the "Submit" button and hide the native button

    ------------------------------
    Hakim S
    ------------------------------



  • 4.  RE: Save and Display Record

    Posted 21 days ago
    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
    ------------------------------



  • 5.  RE: Save and Display Record

    Posted 21 days ago
    Well actually after the record is saved it will show a different form with a QR code. That's why I want the record to be in view mode after the record is created. 



    ------------------------------
    Hakim S
    ------------------------------



  • 6.  RE: Save and Display Record

    Posted 21 days ago
    This is probably possible to do with some new syntax using the %rid parameter and using a rich text formula field.  But I don't know that syntax without doing some research.  I will research if I get a chance or maybe someone else will now understand what you were looking for and chime in.  Or maybe the care team can help you more quickly if you put in a support ticket.

    if you do get it working, please post back with your code.

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



  • 7.  RE: Save and Display Record

    Posted 21 days ago
    Actually this works :)

    var text RID = "%%rid%%";
    var text Display = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & $RID;

    "<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #030404; font-size: 12px \"href='"
    & $Display
    & "'>Save & Display QR Code</a>"

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



  • 8.  RE: Save and Display Record

    Posted 21 days ago
    Nice! Thank you, Mark!!!

    ------------------------------
    Hakim S
    ------------------------------