Save Button that keeps me on the same form.

  • 0
  • 2
  • Question
  • Updated 2 years ago
  • In Progress
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.
Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 2
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.
Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb
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>"
Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb
Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb
This is the code I'm using. "Update"
Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb
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>"
Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb
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>"