How do I display an informative message to the user on Oracle Forms?
647932Jul 2 2008 — edited Jul 2 2008I have been asked to create a database trigger to fire when a user tries to update a column with existing data in it. If the column however has no data in it then the user can update the column with a value.
I tried using the RAISE_APPLICATION_ERROR technique but somehow no message shows up on the frond end of the form when a user tries to update a column with existing data in it. The rest of the trigger works fine. It does not allow a user to update a column with existing values in it, yet it allows user to update column with no values in it.
My problem is displaying a message that reads like this :''Column value must must be 100 "
Here is parts of my code.
CREATE OR REPLACE TRIGGER trigger_name
............
...........
IF :NEW.ATTRIBUTE2 IS NOT NULL AND :NEW.ATTRIBUTE2 <> NVL(:OLD.ATTRIBUTE2, :NEW.ATTRIBUTE2) THEN
RAISE_APPLICATION_ERROR(-20002, 'Column value must must be : ' || :OLD.ATTRIBUTE2);
END IF;
Now i have tried this the syntax below. It does bring up a message on the front end of the form but it is not the message i have in mind.
IF :NEW.ATTRIBUTE2 IS NOT NULL AND :NEW.ATTRIBUTE2 <> NVL(:OLD.ATTRIBUTE2, :NEW.ATTRIBUTE2) THEN
FND_MESSAGE.set_name('FND', 'Column value must
be '|| :OLD.ATTRIBUTE2);
FND_MESSAGE.set_token('MSG', 'r21_AP_INVOICES_TRIGGER()
exception: ' || SQLERRM);
FND_MESSAGE.RAISE_ERROR;
END IF;
Does anyone has any idea?
thx