Forum Discussion

BarryGulino's avatar
BarryGulino
Qrew Cadet
8 years ago

Save Button that keeps me on the same form.

I'm having an issue trying to create a Save Button that returns to the form the Button is on. The Form ID I've placed the Button on is 17. When I click the Save Button it goes to the Main Form. I'm using this:

"Save"

Is there a place in the code where I can put the Form ID#? I've looked at several articles and it doesn't answer this exact question. Although I may be missing something as I'm new to code.
  • Hi,

    Create a formula URL button and insert this code:

    URLRoot() & "db/" & [_DBID_DOCUMENTS] & "?a=API_GenAddRecordForm" & URLEncode ([Record ID#])& "&z=" & Rurl() & "&dfid=17"

    Replace [_DBID_DOCUMENTS] with your table DBID which you can find from the table properties.

    Do not forget to check the option "Save parent record automatically when a child record is created." under the advanced settings from your table properties.

    Please let me know if you need any further help.

    Thanks,

    Gaurav Sharma
  • Dear bgstatdex

    Can you post your current code? It did not come though in your post. I think the pre button at the bottom of the box helps retain the original code.
    • BarryGulino's avatar
      BarryGulino
      Qrew Cadet
      Please help me, I'm stuck and there have no more responses in the community.  I would appreciate it as I'm trying to go live with the project on Monday.

      "<a class='Vibrant Success' onclick=$('#RedirectURL').val(document.location.href.replace(/&rl=[a-z0-9]*/,''));$('[name=rl]').val('');$('#saveButton').trigger('click'); href='#'>Update</a>
  • I was using my iPad to post and it obviously didn't paste.  Try again:

    "<a class='Vibrant Success' onclick=$('#RedirectURL').val(document.location.href.replace(/&rl=[a-z0-9]*/,''));$('[name=rl]').val('');$('#saveButton').trigger('click'); href='#'>Update</a>