This topic is locked
[SOLVED]

 custom button in add/list page to redirect to another related list/add page

8/25/2014 10:40:15 PM
ASPRunnerPro General questions
F
fernandom author

Hello !
I'm trying to redirect a page of names after adding them to a page of dates of the same customer.
in Add page or List Page this is my code in a custom button:
Client Before

Blank
Server

dim data

set data = button.getCurrentRecord()

set result("record") = data

result("cus_id") = data("cus_id")



Client After


location.href="tour_list.asp?mastertable=dbo.customer&masterkey1="&result("cus_id");
When I click on the button, nothing happens

If I remove the "data" or the "result" it takes me to the page, but display all records not only the one I need.
I use ASPRunner Enterprise Edition 8.0
any help or idea ?
thanks in advance
FM

G
gonzalosb 8/27/2014

try this:

http://xlinesoft.com/asprunnerpro/docs/redirect_to_details_page_after_master_record_was_added.htm
this is an automatic function after add or edit

if you wan a button just paste this code on Server.

F
fernandom author 9/1/2014



try this:

http://xlinesoft.com/asprunnerpro/docs/redirect_to_details_page_after_master_record_was_added.htm
this is an automatic function after add or edit

if you wan a button just paste this code on Server.


Thanks, I tried it, but it said: syntax error ";" expected

F
fernandom author 9/1/2014

but thanks to gonzalosb I was able to figure it out:
in the button event:
CLIENT BEFORE
pageObj.on('beforeSave',function(formObj,fieldControlsArr,pageObj){formObj.baseParams['golist']="1";});

$("#saveButton1").click();

return false;
SERVER

empty



CLIENT AFTER


empty
in Add page event
AFTER RECORD ADDED
if ("golist")<>"" then

Response.Redirect "tour_list.asp?mastertable=dbo%2Ecustomer&masterkey1="&values("cus_id")

Response.End

end if
works great !!
Thanks