Hi all,
I have a 2 table setup where I have a project table, and a details table. I have a button in my PowerApp that uses the REMOVE function to delete a row from the project table. I also want it to be able to delete the row(s) from the details table where the project number matches. I created a trigger to do this (I already have 2 other triggers successfully set up on the projects table that update the details table when something happens), but I cannot get it to work. With the trigger disabled, the PowerApp correctly deletes the row from the project table, but enabled it does nothing and even blocks this delete. However when I delete the row from the projects table directly in SSMS, the trigger works fine and deletes the corresponding rows from the details table. Any idea why calling the delete from a PowerApps Remove would be breaking the trigger?
ALTER TRIGGER [dbo].[DeleteDetails]
ON [dbo].[Projects] AFTER DELETE
AS
DELETE FROM Details
WHERE Details.ProjNum in (SELECT ProjNum FROM Deleted)