This topic is locked
[SOLVED]

 redirect to edit page

10/9/2014 9:58:19 PM
PHPRunner General questions
G
gokselkahraman author

Hi

I have a table with many fields in it and I split this table into 7 different custom views.

I am trying to redirect from table edit page to one of the split custom view edit page using custom button called SERVICE.
Table name is defect

one of the custom view from this table called clearance
in defect edit page, custom button client after tab, I have;
);

exit();
i am keep getting error message after building and clicking SERVICE button
[color="#FF0000"]Failed to load resource: the server responded with a status of 404 (Not Found)
What am I doing wrong?
Help appreciated.
By the way, i am using PHPRunner 7.1
Thanks

Sergey Kornilov admin 10/10/2014

You cannot use PHP code in Javascript event. Use Javascript to redirect user to another page. See example #4 in the manual:

http://xlinesoft.com/phprunner/docs/inserting_button.htm
If you need to pass the value of key column from Server to ClientAfter event see 'Passing data between events' section in the same article.

G
gokselkahraman author 10/15/2014

Thanks Sergei, most appreciated. Below is the solution worked for me;
Server Tab:

// get the value of the current record and pass it to the ClientAfter event

$result["record"] = $button->getCurrentRecord();
Client after tab;

//Redirect to another edit page

var $data1 = result.record[";

location.href = '[color="#FF0000"]customviewtablename_edit.php?editid1='+$data1;