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.

VIEW MEMBER FEEDACK TO THIS TIP

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.


MEMBER FEEDBACK TO THIS TIP

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 SearchDomino.com 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

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close