[TYPO3-project-formidable] How to update an existing record?

Uwe Schmelzer us at planungsgruppeinternet.de
Thu Jul 30 11:24:39 CEST 2009


Hi List,
how do I update an existing record?

1. I know how to do it the classic way, as described here:
http://formidable.typo3.ug/reference/control/datahandlerdb.html

This datahandler works by default in CREATION mode. [...]
To make it work in EDITION mode, when invoking Formidable, give the uid 
of the record you need to edit as the third parameter.


2. My Question:
Is there an alternative way to do it?

Example:
My code to deactivate a feuser just keeps inserting new records,
instead of updating the record for the fe user with the uid = 54.

<datahandler:DB>
    <tablename>fe_users</tablename>
	<keyname>uid</keyname>
	   <process>
		<beforeEdition>
			<userobj>
			<php><![CDATA[/*<?*/

/* SOME COMMAND HERE TO SWITCH datahandler:DB into EDITION Mode */
/* e.g.: $this->oForm->oDataHandler->SWITCH_TO_EDITION_MODE();

/* SET VALUES TO BE UPDATED FOR AN EXISTING RECORD */
$aData = $this->getUserObjParams();
$aData['uid' ] = 54;
$aData['disable' ] = 1;
		         /*?>*/]]></php>
		         </userobj>
		</beforeEdition>
             </process>
</datahandler:DB>




Cheers Uwe

-- 
Herzliche Grüsse aus Sindelfingen

Uwe Schmelzer
us at planungsgruppeinternet.de

Planungsgruppe Internet
Parkstrasse 20
71063 Sindelfingen
Tel. 07031 / 704 089
Fax: 01805 / 233 633-00745


More information about the TYPO3-project-formidable mailing list