Link to home
Start Free TrialLog in
Avatar of joekeri
joekeriFlag for United States of America

asked on

FORMS- What does RAISE FORM_TRIGGER_FAILURE do?

I can't find any information on RAISE FORM_TRIGGER_FAILURE.

In this FORMS SQL code, can soemone explain to me what is happening and what RAISE FORM_TRIGGER_FAILURE is supposed to do.

IF :v_comm_desc IS NULL
  THEN
     v_message_text := 'Commodity description is blank.  Please enter a description.';
 
     SET_ALERT_PROPERTY('ALT_OKAY',ALERT_MESSAGE_TEXT,v_message_text);    
     alert := SHOW_ALERT('ALT_OKAY');

     RAISE Form_Trigger_Failure;
end if;
Avatar of Ritesh_Garg
Ritesh_Garg
Flag of United States of America image

Raise Form_trigger_failure raises an exception in the trigger.  So the Form Runtime understands that the execution of trigger has failed, so necessare even should be failed.

When you are using form_trigger_failure, either do not use exception block or in the exception block write code like
  ....
  if  (t_flag = false) then
    raise form_trigger_failure;
  end if;
  ...
Exeception
  when  no_data_found then
    ...
   when form_trigger_failure then
      raise form_trigger_failure
  when others then
   ...
end;

Thanks,
Ritesh
ASKER CERTIFIED SOLUTION
Avatar of Naveen Kumar
Naveen Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The statement
raise form_trigger_failure
prevents the normal (errorles) run of the trigger
and signals to Forms that the trigger run unsuccessful.
This means (if the successful run of the trigger is mandatory - when-validate_item, post-insert, post-update)
that Forms Runtime do not finish the processing and after some user changes will try to
run the trigger again.
joekeri,
Are you reading the answers ?
Avatar of joekeri

ASKER

Thank to Nav Kum V,,, the explanation was what I was looking for.
You are welcome Joekeri.

Thank you.