Solved

Create new documents from multiple fields

Posted on 2006-06-26
10
272 Views
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.

http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_11538338.html?query=export+multiple+fields+as+seperate+entries&topics=133

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.

0
Comment
Question by:Leepingtang
  • 6
  • 4
10 Comments
 
LVL 18

Expert Comment

by:marilyng
Comment Utility
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:
http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_21894688.html
http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_21894965.html
Regards!
0
 

Author Comment

by:Leepingtang
Comment Utility
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>

http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_11538338.html?query=export+multiple+fields+as+seperate+entries&topics=133
0
 

Author Comment

by:Leepingtang
Comment Utility
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?
0
 

Author Comment

by:Leepingtang
Comment Utility
Ok, it worked now.
0
 

Author Comment

by:Leepingtang
Comment Utility
But...
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 18

Expert Comment

by:marilyng
Comment Utility
leepingtang,

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:

one||1a||1b||1c||1d
two||2a||2b||2v||2d

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.

0
 

Author Comment

by:Leepingtang
Comment Utility
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.

http://img254.imageshack.us/my.php?image=tsleepingtang9ff.jpg

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.

0
 
LVL 18

Accepted Solution

by:
marilyng earned 250 total points
Comment Utility
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 :)
0
 

Author Comment

by:Leepingtang
Comment Utility
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!
0
 
LVL 18

Expert Comment

by:marilyng
Comment Utility
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. :)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now