3 Replies Latest reply: May 22, 2013 1:34 AM by Michael Tsilikidis RSS

    Setting a field visibility to dissable once document is printed using print

    1008083
      Hello,

      I a new to Oracle Froms. I am using Forms 10g
      I have a form where I am trying to print the form. Before doing that I have set some of the filelds Visibilty to "Yes" by doing

      set_item_property('Product1.ORDER_QTY',visible, property_true);

      Followed by command

      Print;

      Once the document is printed I want to change visibilty of this filed to "No" by using

      set_item_property('Product1.ORDER_QTY',visible, property_false);

      But the issue is how to identify when this should be done. I though of using "When-Window-Closed Trigger" but I need to know WindowID (for Print). I dont know this.

      Can someone help me find a solution.

      Thank you.
        • 1. Re: Setting a field visibility to dissable once document is printed using print
          Michael Tsilikidis
          Hi,

          you can simply use the command right after calling PRINT:

          PRINT;
          set_item_property('Product1.ORDER_QTY',visible, property_false);

          The capture will run with the item enabled meaning your document will have the item in it.

          Edited by: Michael T. on 10 Μαϊ 2013 3:38 μμ
          • 2. Re: Setting a field visibility to dissable once document is printed using print
            1008083
            I have tried this but what happened is once the print command is executed, it opens printer properties and form also executes set_item_property('reg_program.EEPROM_REV',visible, property_false); which makes the filed dissappear.

            If the I print the document is does not show the field.

            So, can you suggest what to do.

            I am using print option in the default menu.

            Edited by: 1005080 on May 10, 2013 8:50 AM
            • 3. Re: Setting a field visibility to dissable once document is printed using print
              Michael Tsilikidis
              Well, I tried the following in Forms 11g and it works (regardless of what the runtime shows, the item is captured):

              -- the item's property of visibility is set to false
              SET_ITEM_PROPERTY('ITEM1', VISIBLE, PROPERTY_TRUE);
              PRINT;
              SET_ITEM_PROPERTY('ITEM1', VISIBLE, PROPERTY_FALSE);

              If that doesn't work for you, you could do the following, just to be sure that you capture the item and print it:

              -- Procedure MY_MESSAGE is a custom procedure. It causes an alert that requires user's action (to press OK button)
              -- In this way you are sure about the hierarchy of execution.
              SET_ITEM_PROPERTY('ITEM1', VISIBLE, PROPERTY_TRUE);
              MY_MESSAGE('msg','about to start capture');
              PRINT;
              MY_MESSAGE('msg','capture complete');
              SET_ITEM_PROPERTY('ITEM1', VISIBLE, PROPERTY_FALSE);