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

 anyone have this solution?

Print topic Send  topic

Author Message
kirchaj

Posts: 215
Posted: 08/04/2016, 2:25 PM

I am trying to location the codecharge support solution describe in this post

http://www.codechargesupport.com/blog/index.php?action=More&post_id=2

but the site is no longer available

supposedly you can add a new record and immediately return to the form in edit mode with no programming. Looking for the easy way to do this :)
View profile  Send private message
eratech


Posts: 513
Posted: 08/18/2016, 6:32 AM

Yep - *almost* no programming to add record and add ID to query string to load page in Edit mode.

Will try and dig out example tomorrow

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
kirchaj

Posts: 215
Posted: 08/18/2016, 1:03 PM

Thanks Eric. I would really appreciate the assistance.

Tony
View profile  Send private message
eratech


Posts: 513
Posted: 08/19/2016, 12:42 AM

@kirchaj

The rough guide to adding a new record and then returning to that page in edit mode:

1) set up the Record as usual and allow Insert and Update
2) In the Record 'After Execute Insert add 'Declare Variable' of something like:
  
Name: latest_id  
Type: Integer  
Initial Value: mysqli_insert_id($Component->DataSource->Link_ID)  
as this will return the ID of the latest inserted record. Make sure you use the '$Component->DataSource->Link_ID' otherwise MySQL/CCS might not return the right ID.

3) in After Insert, add Custom code with something like:
  
// get the ID into this scope:  
 global $latest_id;  
  
		if ($latest_id > 1)  {   
// optional - update another table, or queue an email etc  
	  
		}	  
  
		// stay on the same page (I've hardcoded 'newrecord_maint' for example)  
// and the ID will automatically set the page to Edit if the ID is found  
		global $Redirect;  
		$Redirect = "newrecord_maint.php?id=".$latest_id.""; 

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
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.