This discussion is archived
3 Replies Latest reply: Jan 18, 2013 4:53 AM by Sachinmrt RSS

message when no data found in set block property

barisist Newbie
Currently Being Moderated
hi,
ı use oracle forms 10.1. when ı use the code below

SET_BLOCK_PROPERTY('MY_BLOCK', DEFAULT_WHERE,     'YEAR=2012') ;
EXECUTE QUERY;

if there is records for year 2012 it works fine. Bu if there exists no record ı get message saying no data found. And then it clears the block. I want to clear block with no messages.

is it possible? thanks...
  • 1. Re: message when no data found in set block property
    Sachinmrt Explorer
    Currently Being Moderated
    Yes. you can add your own message on form level. User ON-MESSAGE trigger and write down the given code :-
    DECLARE 
      msgnum NUMBER       := MESSAGE_CODE; 
      msgtxt VARCHAR2(80) := MESSAGE_TEXT; 
      msgtyp VARCHAR2(3)  := MESSAGE_TYPE;
      ALERT_BUTTON Number;
       
    BEGIN 
      IF msgnum = 40301 then
           
    --HERE YOU CAN WRITE ONLY NULL-------
     /* SET_ALERT_PROPERTY('ALERT_OK',ALERT_MESSAGE_TEXT,'There are No records available for the Query selected by you  !!! ');
             ALERT_BUTTON := SHOW_ALERT('ALERT_OK');
             RAISE FORM_TRIGGER_FAILURE; */
    null;
     Elsif msgnum = 40355 then 
              SET_ALERT_PROPERTY('ALERT_OK',ALERT_MESSAGE_TEXT,msgtxt);
             ALERT_BUTTON := SHOW_ALERT('ALERT_OK');
             RAISE FORM_TRIGGER_FAILURE; 
     Elsif msgnum = 40657 then 
              SET_ALERT_PROPERTY('ALERT_OK',ALERT_MESSAGE_TEXT,msgtxt);
             ALERT_BUTTON := SHOW_ALERT('ALERT_OK');
             RAISE FORM_TRIGGER_FAILURE; 
     elsif msgnum = 40400 then 
              message('Operation completed Successfully');
      END IF; 
    END; 
  • 2. Re: message when no data found in set block property
    barisist Newbie
    Currently Being Moderated
    thanks a lot, it worked...
  • 3. Re: message when no data found in set block property
    Sachinmrt Explorer
    Currently Being Moderated
    If it works then you should mark it is as a answered...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points