Solved

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

Posted on 2006-06-28
9
194 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
[X]
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
  • 5
  • 4
9 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17003173
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
ID: 17003267
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
ID: 17003367
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17003468
> ... 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
 

Author Comment

by:notesrookie
ID: 17005653
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
ID: 17007573
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
ID: 17014157
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
ID: 17014759
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
ID: 17015802
Welcome! Welcome! Welcome! (That was a copy/paste action... ;)
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

617 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