• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Requirement to change multiple fields values.

I have a document containing 4 fields, document A

I want to create a number of other documents  (lets say 5) containing these 4 fields and more.
Once created I want to be able to select these 5 documents and run some kind of script to populate the 4 generic fields with the values of document A.

This means if a value in document A should change in the future, I can run this again.

I hope this makes some sense
0
tashsmith
Asked:
tashsmith
  • 9
  • 8
  • 3
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
> I hope this makes some sense
To me, just a little... Maybe more to someone else over here.

All we get is a vague description of the intended implementation. Is it possible for you to give us the bigger picture: what problem are you trying to solve? What is it why you need these 4 fields in the way you describe?
0
 
Sjef BosmanGroupware ConsultantCommented:
Sorry for my rather blunt answer. Knackered...

As it is almost always the case, lots of things are possible with Notes, but we need a good description of what you want and why you want it. Copying fields isn't he issue, if only we know when. The question also arises: why do these fields need to be copied in the first place?
0
 
marilyngCommented:
Agreed, please provide more details of what you want to accomplish and examples of your fields and how they end up in the other documents.

Also, please tell us how experienced you are with Notes Designer, script, formula.. etc.  What version of Notes will be helpful, along with if this application is for client or for web.

Thanks!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
tashsmithAuthor Commented:
Im Running Domino version 6.5. The application is for client not web. I have a pretty good working knowledge of Notes Designer, although pretty scrappy at LotusScript.

The intended implementation is for a 'global' document to have fields and values that are generic, this is effectively a Master document with a form name="Master"

Lets say it is a master called 'Farm Animals'

Document A or master would have the following values

field1="Farm Animals"
field2= "British"
fields3="animals/farm/native"
fields4="Joe Blogs"

This would populate the view called 'animals".

Also populated this view would be the other type of document created called "Standard".
This would contain the 4 fields   from the master, plus several others.

The user would not see the 4 fields, but onsave would be asked to categorise to one of the 'Masters'

I would then wish to have an Action button, say 'place document/s in category'  that onclick would envoke a box and list the 'Master' documents in the view 'animals', the user would select the 'Master', press ok and the fields from the selected 'Master' would populate one or more documents with the 4 identical fields. The fields need to be editable in bothe the 'Master' and the 'Standard' document types.

I hope this is clearer?

thanks
0
 
tashsmithAuthor Commented:
sjef

I am trying to solve the problem of having a group of documents that have generic values having to be manually changed by users should something global be changed. We may have for example 200 douments all having something in common, if something changes if becomes laborious.

The 4 fields are needed as these are generic values that are required across all documents in a particular group. When one of these change, the corresponding 200 will also need to change.

0
 
marilyngCommented:
So the workflow is:  I create a standard document ( where there might be another 150 of this type)
When I go to close this document, I select a category from Master, say: "British"

Now I have 151 documents categorized as "British"

If I go and change document 145 in the "British" set, when I save and close this document, an agent needs to read it and update all the other documents having the category, "British"

The queryClose event on your standard form can prompt the user to select a category from the Master list.
-You will also need a generic agent that will mark selected documents with a specific category in a view... (for maintenance)

To do your update, then you will need a script library or agent that can be called on query post save that will search a categorized view for all documents having the category, "XXXX" and update the changed fields:  AA, BB, CC, DD.

In order to tell what's changed, you will need to add logic to the postOpen and PostChange event to populate AA_old, BB_old, CC_old with the current unchanged values of the document.  If the document is saved, you compare aa to aa_old until you find one that's changed and update the collection accordingly.  If AA is changed, then you update AA in the collection having "British"

Is this kinda what you mean?
0
 
Sjef BosmanGroupware ConsultantCommented:
If they are global values, and if an update of one of these values requires that other documents from that category be updated, always, then why store those values in the documents? Why not do an @DbLookup the moment you need them??

Still in the dark here... :-(
0
 
tashsmithAuthor Commented:
marilyng

So the workflow is:  I create a standard document ( where there might be another 150 of this type)
When I go to close this document, I select a category from Master, say: "British"

TO BE CLEAR THERE IS 150 STANDARD DOCUMENTS AND ONE MASTER DOCUMENT
WHEN YOU CREATED YOUR NEXT DOUMENT YOU NEED TO CATEGORISE IT TO THE MASTER TO PICK UP ITS VALUES.

Now I have 151 documents categorized as "British"
YES

If I go and change document 145 in the "British" set, when I save and close this document, an agent needs to read it and update all the other documents having the category, "British"
YOU WILL NOT BE ABLE TO CHANGE THE 4 FIELDS SET BY CATEGORISING IT TO THE MASTER, BULK CHANGING NEEDS TO HAPPEN ONLY WHEN THE MASTER ITSELF IS CHANGED, THEN ALL THE 151 DOCUMENTS THAT HAVE BEEN CATEGORISED TO THIS NEED TO CHANGE TO.

The queryClose event on your standard form can prompt the user to select a category from the Master list.
-You will also need a generic agent that will mark selected documents with a specific category in a view... (for maintenance)

I DO NOT WANT TO PROMPT THE USER TO FILL IN THESE 4 FIELDS, THIS SHOULD HAPPEN AS THEY CATEGORISE OR RE-CATEGORISE THE STANDARD DOCUMENT TO ITS MASTER.

To do your update, then you will need a script library or agent that can be called on query post save that will search a categorized view for all documents having the category, "XXXX" and update the changed fields:  AA, BB, CC, DD.

In order to tell what's changed, you will need to add logic to the postOpen and PostChange event to populate AA_old, BB_old, CC_old with the current unchanged values of the document.  If the document is saved, you compare aa to aa_old until you find one that's changed and update the collection accordingly.  If AA is changed, then you update AA in the collection having "British"

Is this kinda what you mean?
NO EXACTLY, I JUST WANT TO BE ABLE TO SELECT ONE OR MORE STANDARD DOCUMENT/S, HIT AN ACTION / SOMETHING BUTTON AND REPLACE THE STANDARD DOCUMENT/S WITH THE 4 FIELD VALUES FROM THE MASTER DOCUMENT. I DO NOT NECESSARY NEED OR WANT IT TO BE AUTOMATIC IN THAT REPECT.

HOPE THIS IS A LITTLE CLEARER.


SJEF

If they are global values, and if an update of one of these values requires that other documents from that category be updated, always, then why store those values in the documents? Why not do an @DbLookup the moment you need them??

Still in the dark here... :-(

OK, BUT I NEED TO GET THEM IN THE CATEGORY IN THE FIRST PLACE.. SORRY THIS IS REALLY HARD TO EXPLAIN.





0
 
Sjef BosmanGroupware ConsultantCommented:
Supposing MasterView contains only Master documents:
    p1:= @DbLookup(""; ""; "MasterView"; Category; "P1");
when you need that value.


> I need them in the category in the first place...
Them?
In the category?

Okay, I'll explain from my point of view.

1) View MasterView with only Master documents, categorized by name (category?)
2) No fields p1, p2, p3 and p4 in the documents!
3) Each document has one category.
4) Whenever the fields p1..4 are needed, look them up

Why do you store those fields in all documents, if they are document-independent?? Redundant data, isn't it?
0
 
tashsmithAuthor Commented:
Hmm ok I see what you are saying, ill have a little play and get back to you.

We do need to store the data in all document yes as I pass this via XML to our website which needs all information.

Ill play with this tonight and get back to you.

thanks

0
 
Sjef BosmanGroupware ConsultantCommented:
Ah, now there's some information we would have liked to have had from the start: you have to produce XML. Could you tell us some more about that, maybe the solution gets simpler all the time...
0
 
tashsmithAuthor Commented:
OK one thing,

Ive 150 documents set to lookup master name ="pigs"
thats fine, if i change one of the fields in this master, I can see how all those standard docs could change using @dbLookup , fine.

However, if we deciede that 30 of these 150 documents need to lookup master name="geese" instead, ths would not handle such a change. I would need to run some kinda script to change the 'master' name such inherit the new values....
0
 
tashsmithAuthor Commented:
Ah yes sorry Sjef, yes we produce XML out the back, but this has been handled ok for some time. What is harder is finding a way for our staff to update and manage these documents without having to manually update critical fields that may be generic over dozens of documents.

When we were running 10 or so documents in each category this was fine, but now we have around 200, its a bit more time consuming as you may imagine.
0
 
Sjef BosmanGroupware ConsultantCommented:
Good news! The field "Categories" is a reserved field in Notes, and has by default all the functions you're looking for!

Make a test database, one form with some data and a field Categories (text, editable, multi-value, I think) and a categoriezed view. The view should have some columns, the first with the fieldname Categories again. Create some documents and open the view. Then click on Actions/Categorize.  Tataaaaa!
0
 
tashsmithAuthor Commented:
WOW really!!!!

OK gonna play with this and get back to you.....

thks

0
 
tashsmithAuthor Commented:
Right ok,

I have one view (Masters) with just 2 Master documents in them. I have used the categorized agent so the view looks like this

Categories |    f1                           |      f2       |      f3       |          f4        |

pigs           |    farm animals/pigs    |     pink     |     8         |          british  |
sheep        |    farm animals/sheep  |     black   |     9         |          french  |

I have also created 10 standard documents and also categorized them, the view looks like this

Categories |    f1                           |      f2       |      f3       |          f4        |

pigs           |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                 |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                 |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                 |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |


sheep         |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                  |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                  |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                  |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                  |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |
                  |   (empty)                   |    (empty)  |  (empty)  |   (empty)      |


Right I guess now what I need is for the Standard document, only when the Categories field is not empty, so after the user has done the categorisation, to lookup each field on categorization.

Now Im stuck...

0
 
marilyngCommented:
I'm still a bit lost here, can you also provide an example of what you want to end up?
0
 
Sjef BosmanGroupware ConsultantCommented:
I'm stuck too now... I said that you can get the value of those fields from the Master document using a DbLookup. In a document, not in a view. What are you exporting, and how are you doing that? It is always a bad idea to use redundant data in your application, unless there is no other practical alternative. Since we still can't figure out where we are going to, we cannot reasonably give alternatives. Can you shed some more light on this??
0
 
tashsmithAuthor Commented:
OK well I found this article which in the most part does what I want to do.

http://www-128.ibm.com/developerworks/lotus/library/ls-settings_tool/index.html

I gave it a go and it works just fine.

sjef the action >> categorize tip, lead me to the solution, so I am going to award the points to you.

Thanks to you both and I hope to have a more explanable question next time.

Enjoy your day
0
 
Sjef BosmanGroupware ConsultantCommented:
Good! And thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 9
  • 8
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now