4 Replies Latest reply on Aug 2, 2011 12:35 AM by tomyum

    Change value of a field at a given date

    tomyum

      Title

      Change value of a field at a given date

      Post

      Hi all,

      I am trying to make the value/content of a field change at a given date.

      My setup is quite similar to the "invoices" starter solution, so rather than explain all my stuff to you I will use this as an example.

      If you would want to make the "status" field change from "pending" to "delivered" automatically when the system time equals "ship date", how would you proceed?

      (if the "invoices" already have this function, can you please explain how to set it up to me anyway? Wink )

      Thanks in advance,
      Tom

        • 1. Re: Change value of a field at a given date
          philmodjunk

          Hmmm, don't think you'd really want to assume you delivered on the ship date, but then we are using this as an example...

          You can define a calculation field as:

          If ( Get ( CurrentDate )  ≥ Ship Date ; "Delivered" ; "Pending" )

          You need to set two things on this calculation field: Change storages options to "Do not store--calculated when needed" or the value will not update correctly as time pases.

          You should select "Text" as the field's return type.

          • 2. Re: Change value of a field at a given date
            LaRetta_1

            This may or may not be a consideration but I thought I should mention it:

            If you want an Invoice to show Pending status even if NO ship date has been entered then you must uncheck (in the calculation dialog box) below where it says 'Do not evaluate if all referenced fields are empty.'  If you don't uncheck this and there is no ship date, the status will be blank because the only field in the calculation is Ship Date ... Get(_) functions (and static text) aren't considered fields.

            This can be important issue if User is searching for 'unshipped' invoices and simply searches pending. 

            • 3. Re: Change value of a field at a given date
              philmodjunk

              A very good point to make! In Database design, the devil is definitely in the details and that's one detail that's tripped me up a time or twelve!

              • 4. Re: Change value of a field at a given date
                tomyum

                Many thanks for the help guys :)