Page 1 of 1

After insert not working 24.10 ?

Posted: 2024-03-04 14:36
by omackeytech
I have a database in AP that worked till 24.10 upgrade.
I run the app and when I add a new record I get this error -
Query:
INSERT INTO `Actions`(`P_Record_ID`, `Name`, `Description`, `Location`, `Context`, `Due_Date`, `Source_Table`, S_Record_ID)
SELECT `P_Record_ID`, `Name`, `Description`, `Location`, `Context`, `Due_Date`, 'Tools_Needed', ''
FROM `Tools_Needed` t
WHERE t.ID =
Notice that right after 'Tools_Needed' the field is null also after' WHERE t.ID ='. That's supposed to be the PK. I looked in the database with PHP Admin and the record doesn't exist. I use the identical code for 'after update' and it works. Of course, the record is in the database anyway using UPDATE.

To me it looks like it's not inserting the record before calling the function 'after insert'.

Any thoughts?
Or is my code wrong?

Code: Select all

	function Tools_Needed_after_insert($data, $memberInfo, &$args) {
		$myID = $data['selectedID];
		$S_Record_ID = $myID;
		$Tn = "Tools_Needed";
		If ($data['Context'] != "") {sql("INSERT INTO `Actions`(`P_Record_ID`, `Name`, `Description`, `Location`, `Context`, `Due_Date`, `Source_Table`, S_Record_ID)
			SELECT `P_Record_ID`, `Name`, `Description`, `Location`, `Context`, `Due_Date`, '$Tn', '$myID' 
			FROM `Tools_Needed` t
			WHERE t.ID = $myID", $eo);
			}
		
		return TRUE;

Re: After insert not working 24.10 ?

Posted: 2024-03-04 15:02
by jsetzer
Duplicate of
viewtopic.php?t=5333

Posting multiple times will not speed up things.