After insert not working 24.10 ?

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
omackeytech
Veteran Member
Posts: 35
Joined: 2014-06-04 13:18

After insert not working 24.10 ?

Post by omackeytech » 2024-03-04 14:36

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;

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: After insert not working 24.10 ?

Post by jsetzer » 2024-03-04 15:02

Duplicate of
viewtopic.php?t=5333

Posting multiple times will not speed up things.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply