Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Create new documents from multiple fields

Posted on 2006-06-26
Medium Priority
Last Modified: 2013-12-18
Dear all experts,
i am currently trying to build a timesheet for my org.
All time favourite, I have multiple row of similar fields which i would like to seperate them different entries.
I am aware that you can actually display them as multiple entries on the same row and export it to excel.
However, i would not like to go that path.
I found a PAQ as below from Snocross, that is to create seperate entries in another form for each rows at an event ( exit form, button click ) or by schedule.


But not sure how this actually works...

The current structure of my form now.

Date of timesheet: ######
Week Number: ( week number of year )
Staff Name: ########
Timesheet Status: ######
Approved by: #######

| No. | Project                               |    Activity         |    Day 1   | Day 2 ...     |  Total Time Spent    |
| 1     |  NSCPT                |  Development  |    2 Hrs    |   2 Hrs      | 4hrs                         |  
| 2     |  CRE Request sys                |   Development |    2 Hrs    |    1.5 Hrs |   3.5hrs                     |
                        Total      |     4hrs    |    3.5 Hrs|     7.5hrs                   |

At a button click, i would like to create seperate entries for each row if they are data in it.
with the following detail.

project name, activity name, name of staff, total time spent, weeknumber + year

Please assist.

Question by:Leepingtang
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
LVL 18

Expert Comment

ID: 16989921
Hi Leepingtang,

sjef provides links to a sample database that does this in sandbox. It's called tablewalker.

See these two answers for some similar solutions:

Author Comment

ID: 16991309
Thanks for the link marilyn but it is not exactly what i am after.
Basically i want to be able to slice and dice the data from each row, say the activity name with it's respective details.
Using the table walker was my other choice before but it will not show the multiple rows on the same form as seperate entries unless it is exported to an excel document.
Am wondering if it's possible to do a click that will actually pulls the value and populate the values of each row as one new document in another form as what Snocross has answered in one of the archived PAQ>


Author Comment

ID: 16997845
Sub Initialize
      Dim workspace As New NotesUIWorkspace
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Set db = session.CurrentDatabase
      Set uidoc = workspace.CurrentDocument    
      Set doc = New NotesDocument( db )
      doc.Form = "F-Activity"
      doc.ts_author = uidoc.FieldGetText( "ts_author" )
      doc.project_activity = uidoc.FieldGetText( "project_activity" )
      Call doc.Save( False, True )
End Sub

Still didnt work...whats the problem?
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 16997916
Ok, it worked now.

Author Comment

ID: 16997917
LVL 18

Expert Comment

ID: 17000065

I'm not understanding how your data is stored.

Usually when I want to create an array of values that I need to manipulate I do this in a field or two
multi value, separate entries with new lines, and then separate each array with  "|" or "||"

So, I would have a hidden field with my array:


Like table walker, I just display the array results in a table.  But if I need to grab a value from the array, not a problem.


Author Comment

ID: 17006640
Thanks Marilyn. One of the requirement that the management want is to produce report using the views.
If i have the data in arrays, the best i can display them is to use a columm that shows multivalue as seperate entries, well unless i exoprt it to excel or something.
The problem is, the reports that i can produce are very restricted.

I want to be able to produce a seperate record for each line / row so i can play around with the data and produce more constructive reports within LN itself.

I have succedded in creating multiple records for each row of fields on a button click. My question is... Is it a good approach to handling such problem?

My timesheet at the moment consist a fixed number of rows with fields.


I am currently using a For and Next statement to go through the fields and pick up values for each day if the first columm is not empty.

LVL 18

Accepted Solution

marilyng earned 1000 total points
ID: 17006789
Ah,  I would probably have created a timesheet for each day, and then displayed these in a categorized view on the form.

But next is to create by week, and display the month in a categorized view.  

When you do by week, you have to decide if the week starts on Sunday or Monday, and can't change the week if you need to report it differently or if the rules change.

Collecting it your way isn't bad, you just have to check to see if the record exists before you create a duplicate.

The only thing I do (if I have to collect it this way) is to create my multivalue fields to display in views on the forms.

So I can stack all the mondays in one field, tuesdays in another and so on.

See what you have to remember is that Notes is not a spreadsheet.  If you were doing a spreadsheet timesheet, it would create a week per worksheet.  And as long as you knew where the cells were, you could create reports from those worksheets.   Most people try to do slam a worksheet into Notes, and then are surprized when it doesn't produce the report.   You treat notes like a database, and collect by day, you can display on the form any relative weeks, or months, but then you can also create very nice reports.

If you can't collect by the day and have to collect by the week, then one form should = one week, not a month.

Again, you design your database according to the reports or the questions you want answered.  So you always start with the reports.  If your reports say you have to manipulate data by the week, then collect by the week, and so on.
But that's my opinion :)

Author Comment

ID: 17007270
Yes marilyn, this is actually my second attempt to create a productivity application.
My very first approach was using the one record per form method as you mentioned. ( one task, one day, one entry)
But complaints i heard was it's less user friendly than the timesheet interface. So i guess i will just stick to using LS to create new records based on the fields and perhaps beautify it a bit by creating buttons for adding rows ( hidding rows, i suppose ). Oh lord, Lotus Lotus...Thanks for your help again Marilyn, girls bravo!
LVL 18

Expert Comment

ID: 17009261
Ah, that's the second requirement for database development: what are the users used to seeing?   So, this way, yes, you pretty much have to do all the logic in script and hidden fields at the bottom of the form.  :)

My other way of doing this is to show them three forms.. two that I really don't want them to use, and so make them miserably difficult to use, and the one I want to use.  This way they choose the form, and can't say they don't like it. :)

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question