Processing large arrays in a Lotus Notes form can be cumbersome and time consuming. This tip gives you the LotusScript code that two Domino developers used to process complicated budget forms for an international company. The solution successfully reduced the coding, debugging and testing time previously required. It also reduced the size of the script library by a factor of 12. Here's their story.
Six years ago, we wrote an application for an international company with offices in 27 countries that would allow their Lotus Notes users to enter budgets for each of their particular sales offices.
The company's budget form contained a profit and loss account (one for each product/customer) and 24 cost and revenue fields for each month and record.
The form also contains 24 x 12 fields and a view key field, for a total of about 3,000 fields per document. Testing the code was a nightmare.
We decided to use a different field-naming convention so that the information following the "_" in the field name represented the month. For example, Frate_1 is the rate for Month 1, Frate_2 is the rate for Month_2, and so on. We found that this naming convention made testing and coding much easier.
This solution moves the rates into a subscripted table in a Lotus Notes document. The LotusScript code effectively reduced the size of the script library by a factor of 12.
(Click on code for enlarged view and script download.)
This can be written as:
(Click on code for enlarged view and script download.)
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip library by member Clive Belsham. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.