Solved

Requirement to change multiple fields values.

Posted on 2006-07-11
20
242 Views
Last Modified: 2013-12-18
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
Comment
Question by:tashsmith
[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
  • 9
  • 8
  • 3
20 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17086311
> 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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17086371
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
 
LVL 18

Expert Comment

by:marilyng
ID: 17086501
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
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!

 

Author Comment

by:tashsmith
ID: 17088783
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
 

Author Comment

by:tashsmith
ID: 17088816
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
 
LVL 18

Expert Comment

by:marilyng
ID: 17089446
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
 
LVL 46

Expert Comment

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

Author Comment

by:tashsmith
ID: 17090939
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
 
LVL 46

Expert Comment

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

Author Comment

by:tashsmith
ID: 17091745
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
 
LVL 46

Expert Comment

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

Author Comment

by:tashsmith
ID: 17091858
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
 

Author Comment

by:tashsmith
ID: 17091922
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
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 17092273
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
 

Author Comment

by:tashsmith
ID: 17092540
WOW really!!!!

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

thks

0
 

Author Comment

by:tashsmith
ID: 17095160
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
 
LVL 18

Expert Comment

by:marilyng
ID: 17095517
I'm still a bit lost here, can you also provide an example of what you want to end up?
0
 
LVL 46

Expert Comment

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

Author Comment

by:tashsmith
ID: 17098202
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17098476
Good! And thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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