4 Replies Latest reply on Mar 11, 2014 8:12 AM by mrztrz

    If-and-then function in FormCalc

    mrztrz

      Dear friends,

       

      Please be so kind to assist. I am creating a form in LiveCycle and need to insert a formula in a field

       

      Basically I need that if the value in DropDownList2 is Great Park and in DropDownList3 is Big Water then the value in NumberField1 should be 250.

       

      Could anyone be so kind to provide me a script in FormClac?

       

      Thanks! Cheers!

        • 1. Re: If-and-then function in FormCalc
          Magus069 Level 4

          On your DropDownList 2 and 3, specify the item values by checking the checkbox Specify Item Values.

          Now you should know what is the number according to the options in the dropdownlists.

           

          From there, you should be able to write you statements...

           

          IF your values Great Park and Big Water values are both 1 then it would be something like this:

           

          if (Reference_Syntax.DropDownList2.rawValue eq 1 AND Reference_Syntax.DropDownList3.rawValue eq 1) then

               Reference_Syntax.NumericField1.rawValue = 250

          endif

          • 2. Re: If-and-then function in FormCalc
            mrztrz Level 1

            Hi, thanks for the answer, I guess it should work but it somehow does not.

             

            I specified the item values as you suggested but when I try to see if it works in "preview PDF", I get the message that "Reference_Syntax.DropDownList2.rawValue" or "Reference_Syntax.DropDownList3.rawValue" is unknown.

             

            I am kinda stuck...

            • 3. Re: If-and-then function in FormCalc
              Magus069 Level 4

              You should not write Referen_Syntax, this only means that you must write the path to the object using the Reference Syntax....

               

              The Reference Syntax is refering to the somExpression of an object, or a part of the somExpression

               

              E.g. i want to access a field in a table inside a subform called frmPayment... My reference_syntax will be be something like:

              xfa.resolveNode("Page1.frmPayment.Table1.Row1.txtValue")

               

              Reference_Syntax = Page1.frmPayment.Table1.Row1

              1 person found this helpful
              • 4. Re: If-and-then function in FormCalc
                mrztrz Level 1

                Great Answer!

                 

                It works fine!

                 

                Thank you so much!