SomeJavaGuy
SomeJavaGuy

Reputation: 7347

Oracle Forms setting item invalid

When I use the When-Validate-Item Trigger, it just executes once, when I want to validate, if an Item is not null. It is giving me the message, that something went wrong now. But now I am able to leave the current record.

Is there any way to set the status of an item to invalid, so the trigger fires more then once. I am using multirecord spec.

Here is some code that illustrates what I'm thinking:

if :system.trigger_item = 'BLOCK.ITEM' then
   if :BLOCK.ITEM is null then
      -- set the item invalid again, becuase it won´t validate the item again, when 
      -- there wont appear any change to this item
      null;
   else
      -- the item is valid, do whatever
      null;
   end if;
end if;

Upvotes: 2

Views: 2045

Answers (1)

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60262

In your when-validate-item trigger, if your trigger code executes successfully without raising an exception, Oracle Forms will mark the item as valid and allow the user to continue.

To stop this behaviour, your trigger should raise the FORM_TRIGGER_FAILURE exception (e.g. after showing the error message).

Upvotes: 3

Related Questions