7 Replies Latest reply on Sep 29, 2015 6:13 PM by ch0c0halic

    Datatype: Text = "Calculated Value" vs "Calculation" - Differentiation

    Suresh

      Dear All,

       

      Had a doubt about "Calculated Value" and "Calculation", Here below I explained clearly.

       

      Image1:-

      Screen Shot 2015-09-28 at 5.36.07 AM.png

      In this Image1, I select the field datatype as "Text" & select "Option", then in "Auto Enter" tab i select "Calculated Value", give input as,

      Application = Get ( ApplicationVersion )

       

      Image2:-

      111.JPG

      In this image2, I select the datatype as "Calcuation" directly, and give input as,

      Application = Get ( ApplicationVersion )


      So What is the differenece between these datatypes ( Image1 & Image2 ) !! Will both give the same result?

      If it is same means why they designed like this?

      Bit confused!!

       

      If the question does not make sense or confuse anywhere, please notify me!

       

      Thanks in Advance,

      Suresh

        • 1. Re: "Calculated Value" vs "Calculation"
          user19752

          function returns text value.

          you choose "text" in "calculation result is", then the result passed as is.

          field holds the value as text.

           

          if the type is not same in after 2 steps, value will be converted.

          • 2. Re: Datatype: Text = "Calculated Value" vs "Calculation" - Differentiation
            wimdecorte

            The auto-enter calculation will be evaluated when the record is created.  So will a regular calculation if the result is stored.  An unstored calculation (which is an option on #2 - under 'storage options') will evaluate every time the field is shown on a layout.

             

            There is no difference in data type.  Both are text.  There is a difference in field type.

             

            As to the example: you definitely do not want a calc to capture the Get(ApplicationVersion).  That is something you set in a variable on startup, but don't store it with your data; unless it is absolutely critical that you know what records are created by what version of FM.

            • 3. Re: Datatype: Text = "Calculated Value" vs "Calculation" - Differentiation
              sreese

              Good Morning,

              I am not 100% sure on this answer, but I know the two are different.

               

              With the auto-insert calculated value it stores the data into the table permanently. It can be modified, but it isn't unless you specifically tell you to.

               

              With the calculated field it will re-evaluate it every time you bring up the record. While this may not be a bad thing, if you have a script that loops through every record it can consume time.

               

              My personal choice has always been to use the text field with stored calculation.

               

              Please others chime in and tell me if I am wrong on my understanding of this.

              • 4. Re: Datatype: Text = "Calculated Value" vs "Calculation" - Differentiation
                wimdecorte

                sreese wrote:

                 

                 

                With the calculated field it will re-evaluate it every time you bring up the record. While this may not be a bad thing, if you have a script that loops through every record it can consume time.

                 

                 

                No.  Only a calculation that is set to be unstored, or that is forced to be unstored (because it references related fields for instnace) will behave like you say and only if the field is visible on the layout.

                 

                If you loop through the records on a blank layout and don't use that field in your script; FM will not recalculate the field.

                • 5. Re: Datatype: Text = "Calculated Value" vs "Calculation" - Differentiation
                  Suresh

                  Ya.. Thanks wim.

                   

                  Sorry!! Actually I used Get(ApplicationVersion) in the image was for just reference purpose.!! Not used in anywhere!!

                  • 7. Re: Datatype: Text = "Calculated Value" vs "Calculation" - Differentiation
                    ch0c0halic

                    The calculated value is automatically "entered" into the field. It can be stored, indexed, and changed.

                     

                    In your example the Calculation cannot be stored or it won't be up to date when the file is opened on a different version.

                     

                    A calculated value is often used for Tax rates and line item costs. For example in the state of CA (USA) the tax rate changed from 8.0 to 8.5. If the "line item total" calculation used a tax field for CA from a tax table then all the 'old' invoiced would have had their tax amounts changed. So you use an Auto-Enter Calculation for the tax rate (or tax amount) to have a value that is stored - it does not change if the original it is based on does change.

                     

                    Need for it to be changed:

                    Scenario: The sales person for an order is 'entered' on the invoice so they receive commission. But the person quits before the order is completed! You can change it to a new person without changing the "Calculation" Salespersons record, which would change it everywhere.

                     

                    Rule of thumb #1, use an AEC when the source data may change after the fact and you don't want it to effect 'old' records. Or it needs to be stored or used in a relationship but the source data in a calculation wouldn't allow it .

                    Rule of thumb #2, use a calculation when the source data is static or where changing the source data is supposed to change everything it is used in.