This topic is locked

Accessing a different table's edit page

12/2/2008 9:46:53 PM
ASPRunnerPro General questions
ngomong author

In 6.0, I'm having trouble figuring out how to do something I do all the time in v5.2:
Often, on a Master-Detail page, I'll change the "Details" link into an "Edit" link so that the user is sent to the Edit page of the Details page, directly from the Master record. I set up the Master and Detail tables so that they both have matching keys. (This is only for 1-to-1 relationships.)
eg/ In the code page of the visual editor, I change:

href="Details_list.asp?{$row.1Details_masterkeys}"



into:

href="Details_edit.asp?{$row.1editlink}"


Is there a way to accomplish the same thing in version 6.0? I tried changing:

{$Details_dtablelink_attrs}



into:

{$Details_editlink_attrs}


... but that did not work, and I wasn't able to find any examples.
Thanks!

clay.

J
Jane 12/3/2008

Hi,
to modify detail link use List page: After record processed event on the Events tab.

Here is a sample:

str="&editid1=" & SafeURLEncode(dbvalue(rs("RecordID")))

record("Details_dtablelink_attrs")="href=""Details_edit.asp?" & str & """"

ngomong author 12/3/2008

Jane, thank you very much, that's perfect, and a much better solution than my previous method! Now, I don't have to worry about losing my changes when I reset the page in the visual editor.
I had to make one small change:

str="&editid1=" & SafeURLEncode(dbvalue(rs("RecordID")))



to:

str="editid1=" & SafeURLEncode(dbvalue(rs("RecordID")))


(Just had to remove the "&" before "editid1", since it's the first parameter being passed over.
Thank you for the quick response! I'm really liking version 6 now!
clay.

ngomong author 12/3/2008

Also, in case it helps anybody else trying to do the same thing, I've figured out something else.
I needed the detail edit page "Back Button" to point back to the Master page (otherwise it goes back to the details list page, which is confusing to the user). I added an event "Edit Page: Before display"

xt.assign "backbutton_attrs","onclick=""window.location.href='Master_list.asp?a=return'"""


Works like a charm!
I'm starting to get a feel for how you're dynamically generating the pages in v6.0. Very slick.
clay.