FORM 关闭实现

 

 

PROCEDURE close_window(wnd IN VARCHAR2) IS

   return_code    NUMBER;

    

    IF (name_in('system.mode') = 'ENTER-QUERY') THEN

      app_exception.disabled;

      RETURN;

    END IF;

 

   /* IF (wnd = 'CUXTRANTIMEW') THEN

      app_window.close_first_window;

    END IF;

 

    IF (wnd = get_view_property(get_item_property(:system.cursor_item, item_canvas), window_name)) THEN

      do_key('PREVIOUS_BLOCK');

    END IF;

    hide_window(wnd);*/

 

  if (wnd = 'QUERY_FIND') then

    if (get_window_property('CUXTRANTIMEW', VISIBLE) = 'FALSE') then

      fnd_message.set_name('BOM', 'BOM_CLOSE_BILL_COMPARE');

      return_code := fnd_message.question('YES', NULL, 'NO');

      if return_code = 1 then  --return yes, the third button

        exit_form(NO_VALIDATE);

      else

        null;

      end if;

    else

      go_block('B_SM_IMP_TEMP');

      hide_window(wnd);

    end if;

  elsif (wnd = 'CUXTRANTIMEW') then

    if (get_window_property('QUERY_FIND', VISIBLE) = 'FALSE') then

      fnd_message.set_name('BOM', 'BOM_CLOSE_BILL_COMPARE');

      return_code := fnd_message.question('YES', NULL, 'NO');

      if return_code = 1 then

        exit_form(NO_VALIDATE);

      else

        null;

      end if;

    else

      go_block('QUERY_FIND');

      hide_window(wnd);

    end if;

  end if;

 

  END close_window;

posted @ 2014-10-14 09:29  ella_luo  Views(501)  Comments(0Edit  收藏  举报