As much as the world has moved on from Notes to a greater or lesser degree, there are some companies who retain systems that run on one or more Notes applications. This has always been part of Notes’ brilliance – the ability to have an application up and running year after year with little maintenance.
Recently, I was approached to do a little maintenance on an existing Notes application. An application that has been running for nearly 20 years.
The Brief
Add a data entry screen to an existing IBM Notes application that would recreate a tick box matrix originally done in Excel. The existing excel form consisted of ~150 rows and 14 columns, 12 of which were clickable.
- Each action should allow the text of that action to be edited by an admin user.
- Each row should be capable of being configured to run as either a radio button (single value) or a checkbox (multi-value).
- Each clickable area MUST sit in it’s own table cell.
Problems
XPages weren’t an option as some of the clients are Basic rather than Standard. It had to be a form.
150 rows multiplied by 12 clickable areas means 1800 clickable items. Throw in the radio/checkbox option and we are up to 3600 fields just for the clickable areas alone!
The Solution
I won’t go into the whole solution – it’s a bit long winded – but, I’ll give you enough background to see why I chose DXL editing.
The solution I came up with is effective albeit very old school: action hotspots on pictures with hide when formulae. The on click event of the “tick” hotspot would populate a hidden field with a value which would then show or hide the tick as appropriate. All very good once the logic was worked out. It was shown to the client and they were delighted. Smiles.
Now, came the labour intensive part: repeat this for the other 149 rows. A simple copy and paste of the row would result in 125 changes to various formulae per row: 18,265 individual text changes, not including clicking. Grrh!
The Pareto Principle is very much in effect in Domino Designer, and it was definitely one of the 80% of underused items that helped me on this occasion: Edit with DXL. It’s accessed by right-clicking on the element you want to edit and choosing “Edit With DXL”.
This option allows you to directly edit a design element in Domino XML (DXL). In my case, this showed a text representation of the binary form. From here I could copy and paste the line that I needed and manipulate the text easily with find and replace. The whole exercise was now reduced from a large amount of time to around 40 minutes.
Gotchas
Be careful when dealing with Paragraphs in DXL. It seems as though each paragraph
<tablecell valign='center'> <pardef id='8' align='center' keepwithnext='true' keeptogether='true' > <code event='hidewhen'> <formula>!@IsMember("AMS"; ResponsibleTeam)</formula> </code> </pardef> <par def='8'> <actionhotspot hotspotstyle='none'> <code event='click'> <formula>actionCode := "AMS"; @If(ActionFieldType = "Radio"; @SetField("ResponsibleTeam";""); @SetField("ResponsibleTeam"; @Trim(@Replace(ResponsibleTeam; actionCode; "")))); @Command([ViewRefreshFields]) </formula> </code> <picture width='32px' height='32px' > <imageref name='tick.png' /> </picture> </actionhotspot> </par> </tablecell>
A couple of other useful tips. Tools > Edit with DXL just opens it with the XML editor. You can do the same from the Package Explorer, by right-clicking and using Open With submenu.
What gets *really* powerful, is from there you can also right-click and choose Compare With > Local History… and see what’s changed.
Thanks for the tip Paul. Will have to look into that.
I use excel with concatenate to do these. Lazy but works well. Flatten the xml into a single line.