I've been developing a form with a multicolumn entry table on it, with 20 rows of fields.  To make life easy for me,  I've developed and tested the fields in one row of the table, and been careful to do self-adjusting formulas as I go: much use of @thisname and @thisvalue, for example, with all the fields called «name»_1.  The plan is then to copy and paste this row to make a "master" row of fields, without the _1 sufix, and then copy and paste the "master" table row into each of the other rows, so that the field rows are named «name»_1, «name»_2 and so on down the table.  Formulas then rely on

rownnumber:=@right(@thisname;"_")

to be able to locate fields in the same row; which all works just fine.  There is, for example, a category_x field on the row that must have a value if the hours_x field has a value; so I have an input validation formula in each category_x field:

rownumber:= @Right(@ThisName;"_");
@If(@GetField("hours_" + rownumber) != "" & @ThisValue = "";@Failure("You must supply a category for line " + rownumber);@Success)

And that works just fine in each row.

However, I then wanted to add another column called pages_x, and have either that column or the hours_x column hidden per row depending on the category value; you either enter hours or pages but not both, driven by the category value on that row.   I have a hidden field on the form (documentcategories, multivalue) that locates the category values that trigger the hidewhen.  Unhiding that field shows me that it has the values I expect.  

I generated a hidewhen as follows for the Hours fields:

rownumber := @Right(@ThisName;"_");
@IsMember(@GetField("category_" + rownumber);documentcategories)

and for the Pages column

rownumber := @Right(@ThisName;"_");
!@IsMember(@GetField("category_" + rownumber);documentcategories)

Note these are opposites via the "!" at the start of the @ismember on the second formula.  

And it doesn't work.  

I can get the hidewhen to works OK if I put the actual fieldname (category_x) in place of the @Getfield in the @isMember first parameter.  I cannot get the truly portable version with @Getfield to work.  

I've tried @getdocfield with @documentuniqueID as the first parameter.    I've tried adding the code to field default formulas to see what happend and whether ultimately the @ismember generates 1 or 0, and indeed in those circumstances I get the values I'd expect.  I've made triply sure that the category_x field (which, as you might have guessed, is a keyword field) has "refresh fields on keyword change" set (and remember that it works if I don't use @getfield), and I've even tried using OnChange to refire the Hidewhens, and none of those have helped.  

All of this is to avoid editing 40 (20 rows, 2 affected fields/row) hide-when formulas, and it's really bugging me that I can't get it to work.  Any ideas as to why it doesn't work?  The Designer help says that @getfield is OK in Hide-when formulas, but that is the thing that appears to be the issue.  I'm annoyed that I'm stumped by this one.  By the way, I'm using Notes client and Designer 8.0.1 for this.   If anyone has any ideas, I'd really appreciate them.  

Comments (0)
Mick Moignard May 30th, 2008 03:44:25 AM