4 Replies Latest reply on Jul 22, 2013 8:31 AM by MStephens

    Is there a When calculation

    MStephens

      Title

      Is there a When calculation

      Post

           I have a field, Status, that I want to auto fill.

           When the date of the request is filled in, I want the status field to show 'Requested'

           Once the PO is received and the PO number is entered, I want the status field to change to 'Approved'

           When the product is received and the date is entered, I want the status filed to change to 'Received'

           But, if I need to cancel the PO, I would like to manually change to "Cancel" as I don't want to delete the request, I want to cancel the PO.  The date requested would still be filled in as would the PO number, but, if I canceled the processed PO, I want to manually change the status to 'Canceled'

           Or maybe I could set up a field to show a 'cancel' date?

           I can make a value list and manually do this, but I would like to automate it.  I think it should be possible, but, since I don't fully understand the different formula's, well:

           I used Case --> Case ( Line Items::Date_Requested ; "Requested" ; Line Items::PO Number ; "Approved" ; Line Items::Date_Merchandise_Received ; "Recieved" )

           But, it just gives me the first, requested, because the field of date requested is filled in.  Since the date requested field does not go empty when the PO number is filled in, it just stays on the first 'test'.

           Thanks for any help in advance.

           M  :-)

        • 1. Re: Is there a When calculation
          philmodjunk

               Case functions select the "result calculation" for the first expression that evaluates as true so you would need to modify the boolean expressions or their order inside the cas function to get the results that you want:

                Case ( Not IsEmpty ( Line Items::Date_Merchandise_Received ) ; "Recieved" ;
                          Not IsEmpty ( Line Items::PO Number ) ; "Approved" ;
                          Not IsEmpty ( Line Items::Date_Requested ) ; "Requested"
                         ) // case

          • 2. Re: Is there a When calculation
            raybaudi

                 Try to revert the order of the items:

                 Case(
            Date_Merchandise_Received ; "Received" ;
            PO Number ; "Approved" ;
            Date_Requested ; "Requested" ;
                 Self
                 )

                  

                  

            • 3. Re: Is there a When calculation
              MStephens

                   So, my first error was not indicating that nothing is empty

                   and it looks like I needed to go backwards.  The last test would be the first thing, which would be requested.

                   I am going to go ahead and make a date PO canceled field.  I am thinking that the new entry should be after received, since the request will be and PO will be added before a cancelation.

                   Thanks guys!  

                   M  :-)

              • 4. Re: Is there a When calculation
                MStephens

                     worked using your formula Phil

                     Thanks for the heads up of order ray

                     :-D