CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 After Insert, new ID to URL: How?

Print topic Send  topic

Author Message
BryantS

Posts: 10
Posted: 08/01/2008, 8:25 PM

Is there a simple way to take the ID created by the Insert of one page as add that to the URL of the next page?

I have looked at the Multi-Step registration and the "Add URL Parameters to a Page" brief description in the help file, but for someone who has been able to do almost everything without learning php or any other code, this seams like the kind of thing that could/ should be done in the Designer codelessly the way hRef and Add Actions are powerful and easy.

Any specific code would be appreciated and where they go using "Page1", "Page2", and "ID" as the basic details.

Many Many thanks SB
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/03/2008, 6:37 AM

I can help you with a short handy method to achieve your goal, to use as little code as possible.
To make sure I confuse you as little as possible I would like you to post here the following information.

Or follow my example and substitute the names yourself.

Based on InternetDB, table officers.
Created a Grid "MultiP0" using Grid and RecordBuilder, only fields officer_id and officer_name.
Created page "MultiP1", using RecordBuilder build record with officer_id, officer_name.
Created page "MultiP2", using RecordBuilder build record with officer_name, officer_position and officer_email.
Open MultiP0, change the select and Insert links to point to MultiP1 (select each and change the href properties)
Delete the record from page MultiP0.
Open MultiP1, set the Return page properties to MultiP2
Open MultiP2, set the Return page properties to MultiP0
This should result in a functional "edit" sequence Grid:MultiP0->Record:MultiP1->Record:MultiP2->Grid:MultiP0
In the above example the URL variable to be passed is officer_id

Either build the example as above and study or substitute your page and parameter names in the following explanation:

The method is the following:
Open MultiP1 in Design, click the record area to have the properties of the page visible.
Check that the 'return page' is set to MultiP2.
Switch to the Events Tab.
1: RightClick the AfterInsert event, choose Add Action, select "Dlookup Action" from the list.
  
Expression: 'last_insert_id()'                     (in between single quotes)  
Domain: ''                                               (just 2 single quotes)  
Criteria: ''                                               (just 2 single quotes)  
Connection: choose your connection from the dropdown list  
Type of traget: Variable (choose from list)  
Target: tempvar	( a name you choose yourself, remember it you need it in step 2)  

Click your design area, reselect the Record, to reget the properties.

2: RightClick the AfterInsert event, (you should see your Dlookup there)
choose Add Action, select "Declare Variable" Action from the list.
  
Name: Redirect                                 (No $ sign, same capitalization I use here)  
Type: Text  
Initial Value: "MultiP2.php?officer_id=".$tempvar   

The AfterInsert Event should show the Dlookup followed by the Declare Variable, if not rightclick and choose Move Up/Down.

Save, generate (Publish all), test.

The CCS way!
Basicaly we are doing the Redirect example from the HelpFile, using the DeclareVariable Action to set it.

Walter
http://donate.consultair.eu





_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
BryantS

Posts: 10
Posted: 08/04/2008, 9:05 AM

EXCELLENT solution! - worked pefectly the first time. Thank you so much.
All I needed was your Add Action/ Declare Variable instruction - clean and simple.

Any chance you have built any credit card transaction interfaces? Another area beyond my expertise....

Thanks again, Bryant
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/04/2008, 9:29 AM

Glad you liked it.
My creditcards I handle through paypal using CodeChargeTools Paypal builder.
Check it out here http://donate.consultair.eu

But to build a complete interface should be (with all others on this forum) not be a problem.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
maxhugen

Posts: 272
Posted: 08/04/2008, 9:24 PM

G'day Walter

I see you've used the CodeChargeTools Paypal builder... I've struggled through the Paypal stuff manually. Not too bad, getting subscription payments (and even changing subscription levels) AOK.

But I've found the PayPal IPN (Instant Payment Notification) a pain, still haven't conquered it. Does the Paypal builder help with that?

Cheers
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/05/2008, 3:36 AM

Max,
Yes it does, it has the IPN as a settable variable.
As you have donated, you have seen the way I handle it there not using IPN.
I have tried to do it there as well, accepting donation and returning to the comment form in order to leave a message. However, the IPN seems not to work in combination with a simple Donate button, or at least I haven't mastered it there yet.

Contact CCT and see what they can tell you.
They do cater for the sandboxing as well though.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.