After using XPages for some time, I am currently coding an interface for 7.0.x Notes Client to allow users to review and update multiple documents at once. Not surprisingly, I’m getting a bit frustrated at how easy it would be in XPages. Just add a repeat control, define the data, add one set of controls, and I’d be done.

But in 7.0.x Notes Client it’s not so easy, though I’m sure lots of you have done it before. I’m creating a table, with a certain number of rows. The users need to see all rows at once, so I can’t set a specific number of rows with a pager, I’ve got to take a guess at an appropriate number of rows. And then there are the computed for display and editable fields so the users can review and edit as appropriate. But at least here there’s one option to speed it up – @ThisName and @ThisValue.

I’m setting the UNIDs of the related documents in the PostOpen and refreshing the document, so my UNID fields are CustUNID_1, CustUNID_2 etc. Then each row has various fields, all ending _1 for row one, _2 for row two etc. So I can use @Right(@ThisName;”_”) to get the numeric portion of the field name and add it to “CustUNID_” to get the relevant universal ID. @GetField allows me to pass a string for the field name, and @GetDocField allows me to get the value, to compute the formula (or Input Translation formula to prepopulate editable fields) like so:

UNID:=@GetField(“CustUNID_” + @Right(@ThisName;2));
@If(UNID = “”; “”; @GetDocField(UNID;”dtlName”))

For the editable fields, in the Input Translation formula, I test for @ThisValue before updating the field. The only limitation for this approach is that @ThisValue can only be used in field formulas, so my hide formulas still need coding by hand. Plus when I make an error in my field’s code, I’ve got to copy the field to all rows. Which I’m about to have to do again, because writing this article has made me realise I’ve messed up. That would be so much easier in XPages….

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top