Create a dynamic table row

This tip shows you how to create a dynamic table row creation with the help of formula at run time.

View member feedback to this tip.

This tip shows you how to create a dynamic table row creation with the help of Formula at runtime.

  1. Create a form "TableForm" with the following fields:
    Key - Text field
    Table - Rich text field.

  2. Save the form.

  3. Create a hidden view "(Table)" with view selection formula as:
    SELECT ((Form = "TableForm"))

  4. Create a column (no need for column name), give the value as field "Key" and then sort ascending/descending order.

  5. Compose "TableForm" form.

  6. In the first field "Key" enter "Table" (without double quotes).

  7. In a rich text field from Create Menu, click on Table, select number of columns and rows and then click OK.

  8. Save the document.

  9. Open the form where you want the dynamic table to be placed.

  10. Create a rich text field with the following default formula:
    @DbLookup("":"Nocache";"":"";
    "Table";"Table";"Table")
    

  11. Compose the form and you will see the table. As you press tab, the rows keeps on increasing.

MEMBER FEEDBACK TO THIS TIP

I can't make this to work. I don't receive any errors, it just doesn't do anything. On the final form with the default formula in the rich text, I get a blank field -- not a table. I get the same results in R5 and R6.

—Gregg B.

******************************************

@DBlookup may or may not run on local databases. If the database is hosted on a server then it runs perfectly. For local databases we have to specify the database name, otherwise it won't work. This is written specifically in Notes help.

In R6 I have tested on a local database and it worked as it should. But with R5 it gave me a problem (with the @dblookup function).

So, the solution could be specifying server and database name in the dblookup function as:

@DbLookup("":"Nocache";"":"test.nsf";
"Table";"Table";"Table")

Where test.nsf is the name of the database and "" before it indicates that the server location is local.

— Phani, tip author

******************************************

I have a table with a row and 10 columns. Each column has a field of type: Text, Computed, Allow multiple values and Display separate values with "New Line." My question is: Can I have a dynamic table and have fields that do not allow multiple values, and the Script go adding rows to my table?

—Liliana O.

******************************************

I don't think it's feasible, because it's not possible to create a dynamic field in Lotus Notes. This table implementation is nothing but a table created at design time in a rich text field and using it in different forms for dynamic purpose.

So, the answer is you can add dynamic rows to a table using script but not fields in it.

—Phani, tip author

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

This tip was submitted to the SearchDomino.com tip exchange by member Phani. Please let others know how useful it is via the rating scale below. 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 Formula Language

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