1 Reply Latest reply on Mar 16, 2015 1:49 PM by scottc30727408

    What is the proper syntax for adding an if statement to control presence settings?

    awmackenzie

      I am new to FormCalc and JavaScript, but I have been trying to do some reasearch and some different syntax.  I have an image field inserted into a subform.  I am trying to have this subform's presence setting adjusted based on a field located somewhere else on the form.  I have been able to get the subform to become hidden based on other fields located on the form, but not with the one I need.  The field is working because it is loading the data correctly with the print tests.  My thought is that I am calling this field value incorrectly for the if statement.

       

      Show:  Events with Scripts

      Language: FormCalc

       

       

      data.#pageSet[0].Page1.Logo::validate - (FormCalc, client)

      if

      (data.Page1.Header.ZWZART.rawValue == CU)

      then

      LOGO.presence

      = "hidden"

      endif

       

      The subform is called (Logo), and I have setup an image field that contains my embedded graphic file.  The graphic field is called LOGO (I know matching names is not the best idea).

       

      I do not receive any syntax errors when checking.

       

      Basically I am tryin gto check the HideField to see is it equals XA, and if it does I hide the subform, but more importantly the graphic.

       

      I have added another text field into this subform and referenced the field I want fromthe context tab to make sure it is populating correctly there as well, and it is.  I have since changed that presence to hidden incase it will be helpful to use.

       

      I have tried looking around, but I am mostly finding examples linking to user entered, or selected fields.  This field get automatically generated at the time of creation.  The user does not drive this answer, and it does not get changed, so it does not need to be updated.

       

      Thank you in advance for any pointers you may have.