Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Update existing documents with a NEW Field?

Status
Not open for further replies.

barsa

MIS
Dec 20, 1999
11
US
I am just beginning to work with Lotus Notes, and my task is to update an existing database by introducing a field into a form that creates an &quot;issue priority number&quot; for each document. Is it possible to update each existing document with this new field to then be able to sort by &quot;Issue Priority?&quot; <br>
Please Help...
 
If the issue priority number is created by a formula and is a consecutive number you could try refreshing each document, one at a time; or you could open each doc, one at a time, put each doc into edit mode and then resave each doc.<br>
<br>
If you are generating a random number then you could try refreshing all the docs.<br>
<br>
You can refresh docs by making a smarticon (file, tools, smarticons) and insert @Command([ToolsRefreshSelectedDocs])to refresh docs one by one or mutliple docs by placing a checkmark next to each one that you want refreshed. To refresh all docs in a view use @Command([ToolsRefreshAllDocs]).<br>
<br>
There may better ways using LotusScript, but I can't help you there; or with an agent to add the issue number.<br>
<br>
I would make a local copy of the database to experiment. <p>Gary (akbryer)<br><a href=mailto:Gary_Bryer@Vanguard.com>Gary_Bryer@Vanguard.com</a><br><a href= > </a><br> <br>
<br>
Good deeds do not go unrewarded!
 
Thanks for the response...<br>
My first task was to create the new field into the form, which I have completed. I have created a new view with the documents using the updated form, (using SELECT Form = formName).<br>
<br>
Now I am trying to figure out how to create a formula for the value of the new field. The field is a &quot;Priority Number&quot; field which will then be able to sort the documents by Priority. <br>
<br>
How could this value/field be created?<br>
What would happen to the other documents' Priority Number if a new document gets created or if an existing document gets &quot;removed&quot;?
 
Will the numbers be consecutive or random? <p>Gary (akbryer)<br><a href=mailto:Gary_Bryer@Vanguard.com>Gary_Bryer@Vanguard.com</a><br><a href= > </a><br> <br>
<br>
Good deeds do not go unrewarded!
 
First, since the existing documents will have to be updated with a value in this new field, I was thinking that I would sort the documents in a view according to how I think they should be prioritized, then CONSECUTIVELY enter the Priority number as they are sorted within the view.<br>
<br>
Once this has been done, and the database has been updated, I am assuming that there would be someone who manages and assigns(manually)the priority from then on...<br>
<br>
Would it be useful to initially have the Priority numbers set in increments of ten (for example) since they will eventually be changed manually?<br>
<br>
Do you have any ideas?
 
If I understand, you or somebody will be adding a number to a form indicating the priortiy. Could be 1,2,3. 1 being highest priorty 3 being the least priority? Or will there be some other type of numbering system?<br>
<br>
The problem with numbering consecutively is, when Notes sorts it will sort all numbers begining with 1 then all numbers begining with number 2 and so on. For example, if docs are numbered 1-10 notes will sort as follows: 1, 10,2,3,4,5,6,7,8,9. There is a work around.<br>
<br>
I guess what I need to know is what numbering system you'd like to use. <p>Gary (akbryer)<br><a href=mailto:Gary_Bryer@Vanguard.com>Gary_Bryer@Vanguard.com</a><br><a href= > </a><br> <br>
<br>
Good deeds do not go unrewarded!
 
I imagined using a consecutive number system, (i.e. 1,2,3,4,...) <br>
Basically, I would need to use a system that would allow for &quot;inserting&quot; a number, and refreshing all the documents.<br>
<br>
What do you see as my options?
 
You could write a formula that would inset the next available consecutive number into the desired field when the record is saved for the first time. (I may have a formula written in LotusScript which may help. I didn't write it. I don't know LotusScript.) You could manually insert the next available consecutive number on the form.<br>
<br>
As far as inserting numbers into existing doc you can put the formula in the field and refresh those docs in order.<br>
<br>
If a record is deleted there will be gaps in the numbering. I'm not sure of the work around. The problem is that when you compute a number or a field you don't usually want it recomputed. Generally, you'd set the field to computed when computed when composed, which would preclude recomputing through refreshing. An Action or an agent could be written which could cycle through each doc and reassign numbers. <br>
<br>
Instead of computing when composed you could set the field to computed which would recompute documents each time the view is opened or when a document is open and edited and resaved, or if you refresh a view. This might produce performace issues.<br>
<br>
Other thoughts: Create a hidden view that will be sorted or categorized by the priority number. Then you could do a @DbLookup to the hidden view selecting the highest number and then adding 1 to it. (I'm sorry, I'm not an experienced programmer). The script that I'm have does essentially what I just described.<br>
<br>
Check out lotus411.com.<br>
<br>
Can you guestimate how may records might be created per day, per week, per month, or per year?<br>
<br>
I'm trying to see if I can find a formula that you could play with. Are you a programmer? How may users do for this db?<br>
<br>
Gotta go, now.<br>
<p>Gary (akbryer)<br><a href=mailto:Gary_Bryer@Vanguard.com>Gary_Bryer@Vanguard.com</a><br><a href= > </a><br> <br>
<br>
Good deeds do not go unrewarded!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top