Solved

Best way to collect data to show in 2 rows for each document in a view

Posted on 2006-06-28
9
187 Views
Last Modified: 2013-12-18
Greetings most learned colleagues,

I'm trying to figure out how to most efficiently display values from 2 fields on the same form in the same line in a view and clear information after a particular procedure is run. I know that I should probably read the information into an array. Can I do that on the form?

Currently I have:
Form
Field1a: number, editable, Field2a: number, editable, ... Field12a: number, editable
Field1b: number, editable, Field2b: number, editable, ... Field12b: number, editable
FieldV1: text, computed, holds field1a:field1b values, ... FieldV12: FieldV1: text, computed, holds field12a:field12b values

The columns holding each of the FieldV1, ... FieldV12, has the multi-value separator as New Line.

As part of running the procedure, I clear the FieldV1, ... FieldV12 by referencing each of them (laborious copy and paste and change but doable). Is there a better way to do this as I have a bunch of these fields that I will need to clear? Like using @For (I read the help but can't get a handle on it)?

Thank you so very much.

0
Comment
Question by:notesrookie
  • 5
  • 4
9 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
I've read your post twice, and it's still Klingon to me...

> ... values from 2 fields ...
You mention 36 fields, and I suppose there are a lot more.

> ... particular procedure ...
??? Would some code be useful?

> ... columns holding ...
You're talking view all of a sudden, I suppose you have 12 columns?

> ... a bunch of fields that ... to clear ...
??? Why

Can you give us:
- a more detailed/exact specification of what you want
- if possible in user terms, e.g. describing the final output
- separate stories for form and view
- input/process/output for the "particular" procedure

There might be better ways to do this than to use a @For. @For that, we need to know @More ;)

Qapla'
0
 

Author Comment

by:notesrookie
Comment Utility
Sjef - Yes there are at least 3 sets of 12 (related to the months of the year), the procedure copies the current year's data (1st set of 12), say 2005, to previous year's data (2nd set of 12) and overwrites what was there previously and clear the surrent year's fields. I mention the view because the 3rd set of 12 is computed to show up in the view. When the procedure is run and even with a view refresh, it still shows the data from 2005 even though the current year's fields are now empty, having been cleared after being copied to previous year. The data still remains in the fields used to compute the values for the view. So I'd like to clear them so as not to confuse the user. But it looks like I'm also confusing you. I can go home now, my job is done! :D I hope this helps calrify my situation. Thank you.
0
 

Author Comment

by:notesrookie
Comment Utility
Sorry - I meant to say "clarify". My logic behind creating the 3rd set of 12 was to have the calculations done in the form instead of the view. I don't speak Klingon - qapla'? It's Greek to me :D Efharisto poli
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
> ... I hope this helps calrify my situation...
Oh, it does, but just a little. Most of my questions are still open, and you're not getting away (with this) so easily! I should have asked for an example, what do you want to see in the form and what in the view.

Let me put myself in assume-mode, translating your description as far as I can get what you're after:

1) about your Form F
- it contains 2 sets of editable fields f1a..f12a and f1b...f12b
- there's a 3rd set of computed fields fv1..fv12, with the combined values (as text list)
    f1:    123  124  125  ....
    f2:    140  144  140  ....
    fV:    "123":"140"  "124":"144"  "125":"140"  ...

2) you have a view V
- with 12 columns that display the values fV, on separate lines

3) there is a procedure P
- when does it work, how is it activated? (agent, button, or something else??)

Why are 2 sets editable, and not only one?
Show multiple values as separate entries is set in the 12 similar columns of the view?
I'd love to see the code of your procedure!

Ah, I think I understand your problem. You run an agent on a document, you set values in a document and you assume the document's values are recalculated? Alas, they are not, you have to do that in the agent.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:notesrookie
Comment Utility
sjef - Good assumptions on your part and here is some further explanation on mine

>> 3) there is a procedure P
      - when does it work, how is it activated? (agent, button, or something else??)

Procedure P is a view action button that calls an agent to do it's thing, that is, for example, let's say that the data currently in the document is from 2003. At year end, after the data has been locked to prevent any further updates, the agent copies the contents of the 12 months of 2003 to a section that contains 12 computed fields. This section is now holds the data from 2003, the current year's data is set to blanks and the data is unlocked. Now each year's data will contain 2 sets of 12 months because the customer wishes to capture data from 2 situations, passed the test and did not pass the test.

>> Why are 2 sets editable, and not only one?

Please see above paragraph.

>> Show multiple values as separate entries is set in the 12 similar columns of the view?

Your assumption 1) is correct. I use new line multi-value separation for each month's column and it is built from the FV fields so that each document will show
     SomeProduct
          Pass             1     2     3     ...     6
          Did not pass  0     1     1     ...     2
     AnotherProduct
          Pass             5     7     9     ...     8
          Did not pass  3     3     4     ...     3

>> I'd love to see the code of your procedure!

If you still want to see it after my latest explanation, please let me know and I'll upload the clunky code. I'm hoping to be able to have more elegant code.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
Comment Utility
Understood. So let's get back to your original question, which is ...? One? Twofold? Threefold? There are three questionmarks there, but the real question I can't find.

1) You want to  
> ... show values from 2 fields on the same form in the same line in a view ...
In the same line? As in: double the number of columns, and use adjacent columns to display value[1] and value[2]??
> ... clear information after a particular procedure is run ...
Not sure what to do with that.

2&3)
> ... a better way to ... (clear) ... a bunch of these fields ...
LotusScript would be easiest, I think. An example

    Dim doc As NotesDocument
    Dim i As Integer
    Dim fieldV(1) As String
    Dim tmp As Variant
   
    ' assume: copy from fieldb to fielda, clear fieldb, recalc fieldV
    For i=1 to 12
        tmp= doc.GetItemValue("Field" & i & "b")(0)
        Call doc.ReplaceItemValue("Field" & i & "a", tmp)
        Call doc.ReplaceItemValue("Field" & i & "b", "")
        fieldV(0)= Cstr(tmp)
        fieldV(1)= "" ' not required, and invariant in the loop
        Call doc.ReplaceItemValue("FieldV" & i, fieldV)
    Next
    Call doc.Save(True, False)

The construct "Field" & i & "a" is a shortscript equivalent to "Field" + Cstr(i) + "a". The &-operator will convert left and right to strings before concatenating.
0
 

Author Comment

by:notesrookie
Comment Utility
sjef - you hit it on the nose!  The real question was how to access the values in the sets of 12 fields without having to type each one out, it's laborious even when cutting and pasting. They all have pretty much the same name just the last bit is different based on the month. I was looking for a construct (but was, obviously, at a loss for words) and I see that you have provided me with much more elegant script that I will test. I be back .... Thank you.
0
 

Author Comment

by:notesrookie
Comment Utility
That was just tremendous! I implemented your suggested code and saved not having to write out or copy and paste a a bunch of lines. No cramped fingers :). Thank you, thank you.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Welcome! Welcome! Welcome! (That was a copy/paste action... ;)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

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

6 Experts available now in Live!

Get 1:1 Help Now