This topic is locked

After Add event

1/29/2008 4:57:24 PM
PHPRunner General questions
D
dmcconnell author

looking for some more guidance.
I have a form for licenses, after the user fills in the information and clicks on save, I would like it to automatically take her to the product form. These two tables are related on license_no. I would like to have the license_no field pre-populated on the product form. Also when the user clicks on back to list from the product form, it should take her back to the list on the licenses table.
Thanks for any help
David.

J
Jane 1/30/2008

David,
to redirect to product page use After record added event -> Redirect to another page action on the Events tab.

Also you can save added license_no in the $_SESSION variable in the After record added event and use this variable as default value on the "Edit as" settings dialog on the Visual Editor tab for product table.

Here is a sample code:

$_SESSION["license_no"] = $keys["license_no"];

D
dmcconnell author 1/30/2008

Jane,
I finally figured this out, and it worked as I expected it to, the problem I have is that if I browse to an existing license then go to add a new product to it, the license_id field on the product page is not correct for the license that I'm currently working with. Any ideas on that?
Thanks,

David

David,

to redirect to product page use After record added event -> Redirect to another page action on the Events tab.

Also you can save added license_no in the $_SESSION variable in the After record added event and use this variable as default value on the "Edit as" settings dialog on the Visual Editor tab for product table.

Here is a sample code:

J
Jane 1/31/2008

David,
you need to save current license_id to $_SESSION variable in the List page: Before process event too.

D
dmcconnell author 1/31/2008

Hi Jane,
When I add $_SESSION["license_no"] = $keys["license_no"]; to license list page: before process,
I get the following error when browsing to license_list.php
PHP error happened
Technical information

Error type 8

Error description Undefined variable: keys

URL localhost/bsalicense/license_list.php?

Error file C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\bsalicense\include\license_events.php

Error line 62

SQL query
Also, how can I change the "back to list" button on the products page to go back to the license_list.php page instead of going to products_list.php?
Thanks,

David

David,

you need to save current license_id to $_SESSION variable in the List page: Before process event too.

D
dmcconnell author 2/2/2008

Any ideas?

J
Jane 2/4/2008

David,
you need to select license_no from database in your List page: Before process event.

You can publish your project on the Demo Account and send link to your pages alogn with your order number to [email=support@xlinesoft.com]support@xlinesoft.com[/email].

D
dmcconnell author 2/4/2008

Jane,
Can you tell me what the code is that needs to go in the list page: before process event? The field in the SQL table is license_id.
Thanks,

David

J
Jane 2/5/2008

Hi,
it's difficult to write sample code without seeing actual files/pages.
You can publish your project on Demo Account and post a URL to your pages here or send it to [email=support@xlinesoft.com]support@xlinesoft.com[/email] and I'll try to help you.