I’m trying to create a new custom event for Work Order Status Change, that fires an error message if the status is changed from ‘PREPARED’ to “WORKDONE’, that warns the user that they have to first set the status to ‘STARTED’ before changing status to ‘WORKDONE’.
Can someone help me out with the SQL code I need to write? The below doesn’t work for me.
--
DECLARE
CURSOR get IS
SELECT '&OLD:WO_STATUS_ID'
FROM ACTIVE_SEPARATE_CFT
WHERE
'&OLD:WO_STATUS_ID' = 'PREPARED'
BEGIN
IF '&NEW:WO_STATUS_ID' = 'WORKDONE' THEN
Error_SYS.Appl_General('ERROR!', 'You must set WO status as STARTED before you can select WORK DONE');
END IF;
END;