5 Replies Latest reply on Jul 1, 2010 8:59 AM by Ida Eve

    FormCalc, Concat - 2nd page script failure

    Ida Eve Level 2

      I want ot thank you in advance on any help anyone might give me.

       

      I am working on a table with dynamic row instances and contains a hidden text field that concatenates the row's data into one so we can export the data easily to our licensing database.  I originally wrote the code in JavaScript, but that would only duplicate the first row's data when another row was added.  So I did it in FormCalc, and the concatenation worked perfectly........ until I got to the 2nd page.  When I add another row on the 2nd page I get the following script error on the FormCalc concat code:

       

      Script failed (language is formcalc; context is xfa[0].form[0].TrainingProgram[0].body[0].Table1[0].Item[2].concatData([0])

      script=

      Item.ConcatData.rawValue

      =Concat(Item.ItemIndex.rawValue, ";",

      Program.FormID.rawValue

      , ";", Item.Cert.rawValue, ";",

      Item.LastName.rawValue

      , ";", Item.FirstName.rawValue, ";",

      HeaderRow.C1.rawValue

      , ";", Item.C1_Hours.rawValue, ";",

      HeaderRow.C2.rawValue

       

      , ";", Item.C2_Hours.rawValue, ";",

      HeaderRow.C3.rawValue

       

      , ";", Item.C3_Hours.rawValue, ";",

      HeaderRow.C4.rawValue

       

      , ";", Item.C4_Hours.rawValue, ";",

      HeaderRow.C5.rawValue

       

      , ";", Item.C5_Hours.rawValue)

       

      Error: accessor "headerRow.C1.rawValue' is unknown......

       

      If I change the language to JavaScript as suggested in one forum answer and the error goes away but the concatenation fails.

       

      I am still fairly new to this and have learned much from the forums, so I might be coding this wrong.  Any help would be greatly appreciated, I have been working on this problem for days now.

        • 1. Re: FormCalc, Concat - 2nd page script failure
          pguerett Level 6

          This is very difficult without seeing the form in action ...but i did notice that the error message talkes about headerRow (lower case h) whereas the script has uppercase HeaderRow. How is the header named in the hierarchy ...and is it consistent throughout the script?

           

          Also when the second page is added the somExpression that addresses each field changes. In the case where all of th efields are on the same page you are running in a context of that page, so in reality your expressions are form1.Page1.HeaderRow.C2.rawValue. You can drop the form1.Page1 part because you are exectuing from that location. Once Page 2 is added the expression becomes form1.Page2.HeaderRow.C2.rawValue...a different expression all togther.

           

          Make sense?

           

          Paul

          • 2. Re: FormCalc, Concat - 2nd page script failure
            Ida Eve Level 2

            I have attached the form, and I might not have it coded right, I am still novice learning it on my own and rely on forums like this for answers.  Thanks for your help.

             

            Eve Tracy

            • 3. Re: FormCalc, Concat - 2nd page script failure
              Ida Eve Level 2

              Here is the form that doesn't have my extra in the code.

               

              Eve Tracy

              Kansas Dept. of Agriculture

              Information Technology

              (785) 368-6261

              eve.tracy@kda.ks.gov

              • 4. Re: FormCalc, Concat - 2nd page script failure
                pguerett Level 6

                You cannot attach files here ....can you send it to LiveCycle8@gmail.com ...include a link back to this thread so I have the issue in context.

                 

                Thanks

                Paul

                1 person found this helpful
                • 5. Re: FormCalc, Concat - 2nd page script failure
                  Ida Eve Level 2

                  Subject: Re: FormCalc, Concat - 2nd page script failure

                   

                  I changed the code back over to Javascript (it is easier to work with). The issue is with the context so I made sure that I put the absolute reference to the Header objects in the expression. I also change the concatData field to User entered optional and put an expression on the click event so I coudl see that the field was being set correctly. You may want to change it back when you are satisfied that it works.

                   

                  Paul

                  ------------------------------------------------

                  Ida Eve> wrote:

                  Thank you very much.  Our JavaScript was similar except for two words, should of sent you that file, but I gave up on JavaScript.  I had this.rawValue= where you had Item.ConcatData.rawValue=.  So not defining the field is what I was doing wrong in JavaScript. 

                   

                  Thank you again!  -Eve

                   

                  --------------------------------------------------------------------------------

                  Just a correction - I did not touch that area ...but this.rawValue would work also. I did combine all of the expression on a single line (there is no continuation) and I think that was causing the bulk of your problems.

                   

                   

                   

                   

                  Paul

                   

                   

                   

                   

                  Message was edited by: Ida Eve