You can achieve this by two ways either at form level or database table level.
At Database trigger:
CREATE OR REPLACE TRIGGER XXOTHRS_BURT
REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
IF :OLD.processed = 'Y' THEN
RAISE_APPLICATION_ERROR(-20001, 'Emp is already processed');
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
- Code the logic on POST-QUERY trigger, set record update allow property FALSE or TRUE based on processed field value
IF processed = 'Y' THEN
SET RECORD PROPERTY = FALSE;
SET RECORD PROPERTY = TRUE;
- ON-ERROR Trigger
-- When user update record then following message raised.
IF ERROR_CODE = 41050 AND :processed = 'Y' THEN
MESSAGE(‘Emp is already processed’);
Note: above logic based on single record displayed on screen.
Assalamu alaikum farhan,
Thanks for the reply, I tested on both db trigger, form working perfect, but preffered on form level.
Under block, POST-QUERY trigger
IF :XXFUJOTHRS.PROCESS_FLAG = 'Y' OR :XXFUJOTHRS.PERIOD_CLOSE = 'Y'THEN
thanks a lot...