Adding this script will automatically update the database at the appropriate location so one doesn’t need to go and manually re-add an action to a rule in the event of an action name change.
Execute this script inside your favourite IDE (like SQL Server Management Studio)
Make sure that SambaPOS5
in USE SambaPOS5
is your correct database.
/* Update ActionContainers on Action Name Change */
USE SambaPOS5
IF OBJECT_ID('dbo.trg_app_actions_update') IS NOT NULL
DROP TRIGGER dbo.trg_app_actions_update;
GO
CREATE TRIGGER trg_app_actions_update
ON AppActions
AFTER UPDATE
AS
BEGIN
DECLARE @ActionID INT
DECLARE @ActionName NVARCHAR(50)
SELECT @ActionID = Id FROM INSERTED;
SELECT @ActionName = Name FROM INSERTED;
UPDATE ActionContainers
SET Name = @ActionName
WHERE AppActionId = @ActionID;
END;
Or, unzip the following file place the script in %USERPROFILE%\Documents\SambaPOS5\Database Tasks
(unless installed in a location other than default).
[CBL]auto_trg_update_action_containers.zip (489 Bytes)
Go to Management -> Settings -> Database Tools and select auto_trg_update_action_containers.sql
then select “Execute Task”.
There will be an automatic backup.
Now when changing an action name instead of seeing things like this:
you’ll see no popups or this after testing rules: