automazione wrote:just a quick suggestion.. you can use the readOnly property associated to the form. I play quite often with that... put it on false when adding a new record... set it to true when browsing the old records...
CREATE TRIGGER trg_acc_documents_lock_check
BEFORE UPDATE OR DELETE
ON acc_documents
FOR EACH ROW
EXECUTE PROCEDURE acc_document_lock_check();
CREATE OR REPLACE FUNCTION acc_document_lock_check()
RETURNS "trigger" AS
$BODY$
BEGIN
IF TG_OP = $$UPDATE$$ THEN
IF NEW.document_locked = 2 THEN
NEW.document_locked:= NULL;
RETURN new;
ELSEIF OLD.document_locked = 1 THEN
RAISE EXCEPTION $$Cannot update a locked document number %$$,OLD.document_number;
ELSE
RETURN new;
END IF;
END IF;
IF TG_OP = $$DELETE$$ THEN
IF OLD.document_locked = 1 THEN
RAISE EXCEPTION $$Cannot delete a locked document number %$$,OLD.document_number;
ELSE
RETURN old;
END IF;
END IF;
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
Westy wrote:Interesting. How can I set the readOnly property associated with a form?
Westy wrote:Have you tried it with webclient?
Users browsing this forum: No registered users and 7 guests