5 Replies Latest reply: Feb 11, 2011 9:00 AM by Tom Cotterill RSS

    Trigger OnOpen Date Range

    Tom Cotterill

      Hello,

      I am pretty sure there is a simple answer to this but I have drawn a blank!

      I have two date variables populated with a Start and an End date.

      What I need is the date field to be set to this date range when the document is opened.

      I cannot see a way of setting a range in the Select in Field Action of the Document Event Triggers.

      Any help will be appreciated!

      Thanks.

        • Trigger OnOpen Date Range
          Deepak Kurup

          HI.

          Go to Document properties--> Trigger-- > OnOpen --> Add Action--> External-->Setvariable

           

          YOu might have to do it twice to add values to from and to date

          • Trigger OnOpen Date Range
            Tom Cotterill

            Hi,

            Thanks for the reply. My issue is not setting the variables, that part is fine. Sorry if I was not clear.

            My problem is applying the values of the variables to the date field when the document is opened.

            For instance, I set the end date to the latest activity in the financial year (say 15/10/2010), and the start date is simply the beginning of that year (01/04/2010 for example). Now, when the document is opened, I would like the date field to be set to the range 01/04/2010 to 15/10/2009.

            • Trigger OnOpen Date Range
              Tom Cotterill

              Hi,

              The field is used all over the application.

              Is there a way to make an OnOpen trigger that will set the a DateField field to a range as opposed to an individual date. Essentially I require the equivalent of:

              Settings > Document Properties > Triggers > OnOpen

              Action: Select in Field

              Field =DateField

              SerachString: =Between varStartDate AND varEndDate

              So when the user opens the application the DateField will already be set to the year to date latest data.

              Maybe I need a Macro for this and fire the Macro in the OnOpen trigger.

              • Trigger OnOpen Date Range
                Tom Cotterill

                D'oh I knew it was going to be simple enough:

                 

                ='>=' &

                varStartDate & '<=' & varEndDate



                Silly me.