4 Replies Latest reply on Oct 28, 2012 5:03 PM by ChrisSmythe

    Calculation for DeployedStatus Field

    ChrisSmythe

      Title

      Calculation for DeployedStatus Field

      Post

           Hello, I am using FileMaker Pro 12 on Windows XP.

           I am hoping someone would please be kind enough to help me with the following FileMaker Calculation:

           I have a link to my Test 11.fmp12 database (Account Name: Admin & Password: "there is no password" just click OK.

           https://www.sugarsync.com/pf/D0681807_60165357_21551

           I need a calculation that changes the DeployedStatus field from Pending to Deployed --- in the following table:

           DbUserEdits table --- DeployedStatus field; and
           DbUserEdits table --- DeployedDate field.

           If there is a DeployedStatus field that = Pending and has a DeployedDate field that = "Today's date",

           then the DeployedStatus field needs to change to: Deployed.

           This calculation needs to be applied to all records in the DbUserEdits table.

           Any help would be greatly appreciated.

           Kind regards,

           Chris :)

        • 1. Re: Calculation for DeployedStatus Field
          Sorbsbuster

               Try:

               Case (
               DeployedStatus = "Pending" And DeployedDate = Get ( CurrentDate ) ; "Deployed" ;
               "Whatever it should be if that is not the case"
               )

               You need to make it an unstored calculation or else it will only evaluate once.

          • 2. Re: Calculation for DeployedStatus Field
            schamblee

                 Sorbsbuster is using a calculation, which is what you asked for.  Calculation fields can't be modified.  You would not be able to change from Deployed  from your drop down list.  You can use a script trigger on the DateDeployed Field.  You would use onObjectModify then create a script which could use a case statement. I used a if statement

                 If[DbUserEdits::DateDeployed=Get(CurrentDate) and DbUserEdits::DeploymentStatus="Pending"
                   Set Field [DbUserEdits::DeploymentStatus;"Deployed"]
                   Commit Records/Requests [No dialog]
                 End If

                 If you used a calculation to set this field, you would have to add on to your calculation to set the field to "Not Deployed" or to "Pending".

                  

            • 3. Re: Calculation for DeployedStatus Field
              ChrisSmythe

                   Hello Sorbsbuster & S Chamblee - thank you for your kind assistance and help - very much appreciated.

                   Kind regards,

                   Chris.

              • 4. Re: Calculation for DeployedStatus Field
                ChrisSmythe

                     Thanks again Sorbsbuster & S Chamblee.  I am now looking up FileMaker help on how to set up a trigger script and use onObjectModify.

                     Kind regards,

                     Chris.