Problem solve Get help with specific problems with your technologies, process and projects.

Fiddling with fields in tables

I have a proposal document with a table with four columns and 12 rows such that each row is specific to different items. There is an additional field outside of the table called status and when the status field value is 80% I would like to take the fields with the table that cross multiple items and create a document for each of those rows, while copying all the other fields outside the table into the documents it creates. Is this possible? If so do you have any ideas as to how I can do this?
You can access fields within tables exactly in the same way as you would access them outside tables. In this scenario, you would probably give each field a telling name like cell11, cell21, etc. I'm not sure how you are getting the value of the status field, but if it is something a user inputs, you could put code on the Exiting event of that field to do something like the following. If you only wanted to create a document conditionally on crossing multiple items, that would be additional code, but the gist of what I think you need is below.
 Dim uiws As New NotesUIWorkspace, 
rowNum As String, i As Integer,
 s As New NotesSession
 Dim uidoc As NotesUIDocument, doc 
As NotesDocument,db As notesdatabase
 Set uidoc = uiws.CurrentDocument
 rowNum = Inputbox$("Which Row 
do you want to calculate?","Row Calcs",1)
 Set db = s.CurrentDatabase
 Set doc = db.CreateDocument()
 For i = 1 To 3  ' (where 3 is the number 
of columns in a particular row)
  Call doc.ReplaceItemValue("cell" + 
Cstr(i), uidoc.FieldGetText("cell" + 
rowNum + Cstr(i)))
 doc.Form = "Form" + rowNum
 Call doc.ReplaceItemValue("outsideF1", 
 Call doc.ReplaceItemValue("outsideF2", 
 Call doc.save(True,False) 

Dig Deeper on LotusScript

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • 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 ...