I have replaced design on database where a new field with a default value is set on a current form. Common with notes, a view does not display the value of the new field in existing docuemnts, but it is in the doc level.
I made a view action that will run on the view that will refresh the docs so the new feild is "known’ at the view level. I used… @Command( [ToolsRefreshAllDocs] ).
Works great.
I have 400 databases I need to do this to. I wrote some lotusscript to help out. I can get a handle on the database, and on the view that I need to refresh.
I try to use “notesView.Refresh” to do the same thing as @Command( [ToolsRefreshAllDocs] ), however after it runs, I do not see the feild at the view level as I would using the @Command. Designer help uses these two as a Language cross-reference.
I know the @Command( [ToolsRefreshAllDocs] ) runs on the UI view however, with the LS, I am hitting the back and and don’t want to open the databases to do this.
What do I need to do to get lotus Script to perform like @Command( [ToolsRefreshAllDocs] ) when I am running on the backend?
Subject: @Command( [ToolsRefreshAllDocs] ) and notesView.Refresh
The designer help is misguided if it lists these two as the same function in different languages. I think it was indicating that they are similar, but they are not the same. In order to refresh all documents in LotusScript, you actually have to either a) make a change to the document and save it, then move on to the next one; or b) get a document collection and do a StampAll. Seems like the second choice would be the simplest; you get your NotesSession, get your directory, loop through the databases. In each database, get a NotesDOcumentCollection by doing NotesDatabase.AllDocuments. Then just call collection.StampAll with the new field name and value. No saving needed; just move on to the next database in the loop.
Subject: RE: @Command( [ToolsRefreshAllDocs] ) and notesView.Refresh
This is pnabs what I am working with and they are scattered accross many servers. I have a way where I open them as I do have their paths, but I don’t want to add any new items to the docs.
I tried to use ComputeWithForm but that was not giving the results I wanted and it took a few years to complete.
Maybe making somekind of change may work. Being the pnab, I want to be careful.
Thanks for the help. Any other ideas is always welcome!
Subject: RE: @Command( [ToolsRefreshAllDocs] ) and notesView.Refresh
Maybe I misunderstood, but you said you added a new field to the form and want the view to display the value of that. In order to do that, you need to add the item to each document that displays in the view. That’s what RefreshAllDocs does - it doesn’t update the view, it updates the documents in the view.
Subject: RE: @Command( [ToolsRefreshAllDocs] ) and notesView.Refresh
I added a new field in the pnab template which has a default vaule. There is also a new column in the contacts view to display this field/value. Then I do a design replace to the production pnab.
Simple stuff.
When I go into the contacts view on production, which has the new column that should display the new field as part of the new design, it is not available, because it is a new design element on existing docs. If I run @Command( [ToolsRefreshAllDocs] ) on that view, all works fine and the new field/value is displayed.
I want to do that with LS, but I don’t want to add another item. I guess I could do somekind of change and then save, but being it’s peoples contacts, I would like to limit what I can do.
Bottom line, @Command( [ToolsRefreshAllDocs] ) and notesView.Refresh have nothing in common. This is the 2nd time in very recent memory that Domino help has let me down… I really hope Lotus does an overhaul on its documentation… it needs it.
Oh well, thanks much for the help. If there is something that might help, any ideas is always welcome!!
Subject: RE: @Command( [ToolsRefreshAllDocs] ) and notesView.Refresh
As I explained, by doing a ToolsRefreshAllDocs, you ARE adding a new item to the documents. Any time you add a new field to a form with a default value and refresh the document, it adds an item to the document. The only difference is, using LotusScript you actually KNOW you’re adding an item, whereas you apparently weren’t aware of it when using ToolsRefreshAllDocs. It sounds to me like you don’t really understand what an item is. Every field on your form is an item on the back-end document.