Skip to main content
Question

Embedded button: URL Syntax

  • January 22, 2020
  • 0 replies
  • 101 views

I think my syntax is wrong, but I am unsure as to where exactly.

I have a URL button in a child table that edits a few fields.
I have that button in an embedded report in the parent form.
My goal is to be able to click that button from within the parent form, have the edits made to the child record, and then return back to the parent form.

Here is my simple code:

URLRoot() & "db/" & Dbid()
& "?act=API_EDITRecord&rid=" & [Job ID#]
& "&_fid_177=" & Now()
& "&_fid_178=" & UserToName(User(), "FF")
& "&z=" & Rurl()

The changes are made but it doesn't return back to the parent record form. It gives me a XML error message.

My thought is that although I am clicking the button from within the parent record form, I am not passing down the Parent Record ID# so that the button can return to the correct Parent record form. Am I close???

------------------------------
Andrew
andrew.fry25@gmail.com
------------------------------
This topic has been closed for replies.

  • Registered
  • January 22, 2020
Hi Andrew, 

What is the error message that you are getting?  The RUrl will not work in this instance.  You are using the EditRecord API, which will edit the record without any user interaction beyond pressing the button.  This means that you would need to use "&rdr=" & URLEncode(URLRoot() & "db/" & DBID() & "?a=dr&rid=" & Primary Key Field) or you would need to use "key " instead of rid if you are using a primary key other than the default record id.  This should get you back to the parent record.

------------------------------
Brandon Drake
JHI Group
Monroeville OH
------------------------------