CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Yet another 'SetValue' problem...

Print topic Send  topic

Author Message
Francis
Posted: 10/17/2005, 1:56 PM

A strange problem (or perhaps I can't see the wood for the trees)...

I'm trying to implement set 4 fields when a record is edited and/or created as follows:

Created_User_ID
Created_Time
Modified_User_ID
Modified_Time

I thought I would be really clever and put the following code in common.php:
  
//FransCustomCode  
  
  function setCreatedInfo( &$form) {  
        $userID = CCGetSession(UserID);  
		$timeNow = date("Y-m-d H:i:s");  
		$form->Created_User_ID->SetValue($userID);  
		$form->Created_Time->SetValue($timeNow);  
		$form->Modified_User_ID->SetValue($userID);  
		$form->Modified_Time->SetValue($timeNow);  
    return 1;  
  }  
  
	function setModifiedInfo( &$form) {  
        $userID = CCGetSession(UserID);  
		$timeNow = date("Y-m-d H:i:s");  
		$form->Modified_User_ID->SetValue($userID);  
		$form->Modified_Time->SetValue($timeNow);  
    return 1;  
  }  
  
//End FransCustomCode  

I gave a "contacts_maint_edit" page which is an add/edit form for contacts and put in the following code:

Before Insert:
  
setCreatedInfo($contacts);  
and before Update:
  
setModifiedInfo($contacts);  

but to no avail.

I tried verifying the code by changing the before update code to:
  
     $contacts->Modified_Time->SetValue(date("Y-m-d H:i:s"));  
     $contacts->Modified_User_ID->SetValue(CCGetUserID());  

and neither field values are changed.

Can someone show me the light?

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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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