Manage Learn to apply best practices and optimize your operations.

Dynamic table solution using an embedded view

Instead of hard coding a table when you are not sure how many rows you need you can create an embedded view with response documents to act as rows.


Instead of hard coding a table when you are not sure how many rows you need you can create an embedded view with response documents to act as rows.

We've all had a situation where we need a dynamic table inside of a document. We just don't know how many rows are needed. So we pick a good number that will work for most situations and create a hard coded table. Another method is having the one edit row at the top of a table and moving that row into a table. It works great if the text in the rows does not wrap, or if you have no need to access specific data in a particular row.

A good example of this is a requisition or a purchase order:

  1. With the Embedded View feature you no longer have to deal with hard coded rows. Create your main form for the header portion of the requisition.

  2. Create a response document form that would have the information for each requisition row.

  3. Create a view that displays just the response documents categorized by a field that is carried down from the main form (i.e., PO number or ParentUNID). Include in this view the information that makes up a row (item, quantity, price, extended price). Allow the rows to expand as needed.

  4. In the main form create an embedded view object. In the Embedded section put in the view name. In the 'Show Single Category' put the field name of the category. Uncheck the 'disable scroll bars' property.

  5. Add a button to the main form just above the embedded view that performs an @Compose on the response document.

Now the user can create as many rows as needed and scroll through them. You can add totals to the view as well. The user can double click on any item to open the row and change the values and save it.

If you want to make it really slick, create the view and allow 'Inviewedit'. Then the users can edit the rows inside the embedded view object just as they would a table. The users will always deal with one document not realizing that all the rows are response documents.


I just wanted to write to say that this is a very very elegant solution and by far the simplest and most flexible I have ever seen in the many articles I've read on the web regarding this topic.
—Stephane S.

Do you have comments on this tip? Let us know.

This tip was submitted to the tip exchange by member Julie Snyder. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on Lotus Notes Domino Coding and Development



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury