Expand my Community achievements bar.

SOLVED

Script fails with 1 user--not other users

Avatar

Level 7

Hi,

I have a problem with a single user where a script on the preOpen event of a dropdown box fails. The script is in FormCalc.

The error message says:

Error: accessor 'Cell' unknown.

I use various hidden tables to store 2 dimensional arrays and name every row 'Row' and every cell 'Cell'. This allows me to access information for things like dropdown box values using a loop for filling dropdown boxes and looking up values, etc.

I have used this technique for a couple of years and there hasn't been any problem encountered with scores of users. I had this user, completely uninstall Reader 9.x and go to the Adobe.com and install X. They encountered the same exact problem with X.

She's running WinXP.  Any insights?

Stephen

1 Accepted Solution

Avatar

Correct answer by
Level 10

Ok,

I was only guessing how your form looks like, thougt you're table is dynamically, so I used the instanceManager.count method.

If not you can also can use a fixed value as you mentioned.

Same goes for the columns.

In this case you also can drop the second loop.

The variables aren't used outside the loop so I put them into it.

But it will also work with the varibales outside.

You cannot use the nodes.length method, when the table has header/footer rows.

View solution in original post

7 Replies

Avatar

Level 7

What I'm trying to say is that the script fails with 1 user and nobody else.

Avatar

Level 10

Hi,

can you share the form? I would like to check it.

Avatar

Level 7

Hi all,

Here is the script for the preOpen event that fails with 1 user:

//////////////////////////////////////////////////////////

    $.clearItems()

    var MH         = SubformHeader.SubformFormType.ExclGrpMobileHome

    var oMH

    var OO         = SubformHeader.SubformFormType.ExclGrpOwnerOccd

    var oOO

    var Seas     = SubformHeader.SubformFormType.ExclGrpSeasonal

    var oSeas

    var Typ     = DdlRateType

    var oTyp

    var Desc

    var j = 0

   

    for i=1 upto 47 step 1 do

           

       

        oMH = SubformControlPanel.CPWrapper1.TableHORates.Row[i].Cell[2]

        oOO = SubformControlPanel.CPWrapper1.TableHORates.Row[i].Cell[3]

        oSeas = SubformControlPanel.CPWrapper1.TableHORates.Row[i].Cell[1]

        oTyp = SubformControlPanel.CPWrapper1.TableHORates.Row[i].Cell[4]

        Desc = SubformControlPanel.CPWrapper1.TableHORates.Row[i].Cell[0]

       

        if (MH == oMH  and  Seas == oSeas  and  Typ == oTyp and  OO == oOO )then

            $.addItem(Desc, i)

            j = j+1

        else

            continue

        endif

    endfor

   

    if(j==0)then

        xfa.host.messageBox("No Policy Types match the combination of choices for:

       

        Mobile Home

        Owner Occupied

        Seasonal

        Rate Type

       

Please try changing one or more of the above","Coverage Mix Unavailable",3)

   

     endif

xfa.host.resetData("xfa.form.form1.Subform2ColumnWrap.SubformLeftColumnWrap.SubformPropCoverages.SubformTypeDeduct.DdlFireClass")

////////////////////////////////////////////////////////////////////////////////////////////////////

Thanks,

Stephen

Avatar

Level 7

Hi radzmar,

Thank you! very much for your suggestion.

I'd like to understand your solution a little better:

  • the TableHORates has 14 columns (Cell) containing other rate and features information for each of the products--this script only uses the 1st 5 cells. So, I think
    for c=0 upto Cells -1 step 1 do
    should be
    for c=0 upto 4 step 1 do
    or
    assign var Cells = 5  //above
  • are you concerned about variable scope when you declare the variables within the loop? This is something I never considered. If so, if this is the best practice? or essential?  I'd like to understand better.
  • finally--the rows are not instances--just named alike
    I believe I tried the method: TableHORates.Row.instanceManager.count
    and it doesn't work for objects that happen to be named alike--you can access them using a loop but the instanceManager doesn't work on them. The nodes.length might work for this, too? Or not? Or, just assign the value to var Rows = 47

I'm especially interested in understanding if scope is the problem.

Thanks,

Stephen

Avatar

Correct answer by
Level 10

Ok,

I was only guessing how your form looks like, thougt you're table is dynamically, so I used the instanceManager.count method.

If not you can also can use a fixed value as you mentioned.

Same goes for the columns.

In this case you also can drop the second loop.

The variables aren't used outside the loop so I put them into it.

But it will also work with the varibales outside.

You cannot use the nodes.length method, when the table has header/footer rows.

Avatar

Level 7

I am marking this as answered--I need to make changes and put in front of the user that has problems. This may take a day or two to have the user to test it. I really appreciate your help radzmar. I will re-post this problem if it remains unresolved after testing.

Stephen