View acting strange

Greeting all,

I added a computed field to my form that does an @DbLookup based on the value from another field. I created a new view to show this new field as a categorized column. All the docs show up as Not categorized. However when I open a doc and close it then the vlaue in the columns shows up correctly. Can I replicate this is in a script? I used the agent below and even though i asked that selected documents be processed only the last one gets processed. Would you please let me know where I went astray? Thank you.
notesrookieAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

notesrookieAuthor Commented:
Agent used:

Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
      
Set uidoc = workspace.CurrentDocument
Set uidoc = workspace.EditDocument( False )
Call uidoc.Close
0
marilyngCommented:
First problem, check the new view index properties on the index tab, and make sure it is set differently from the default.  

Also, check the first tab in the view properties and set it to automatically refresh.

Hmm.. not at home to check the code you posted.. maybe someone else will post.
0
SysExpertCommented:
You need to do a refesh

RE: How to recalculate the computed fields in back end?
Posted by Brad Stickley on 18.Feb.01 at 10:14 PM using a Web browser
Category: Domino Designer -- LotusScriptRelease: 5.0.4Platform: Windows NT


Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim orderNum As String

Set db = s.CurrentDatabase
Set view = db.GetView("Your View Name Here")
Set doc = view.GetFirstDocument

While Not (doc Is Nothing)
x = x + 1
Print "Now Updating Document # " + Str(x) ' Prints the document Number that is being updated
returnFlag = doc.ComputeWithForm(False,True)
If (returnFlag) Then
Call doc.Save(True,False)
End If
Set doc = view.GetNextDocument(doc)
Wend

End Sub

or there is a @function that wil do this also i R6 and above I think

I hope this helps !
0
SysExpertCommented:
Last Modified: Wed, Jan 13 1999

If you frequently change the design of a form, especially making a few fields computed from editable, you need to know this (maybe you know this already!).

Details

Computed fields on a form won't get computed unless you open the document in the UI and refresh it.  If you have changed the design of a field from editable to computed and if you had a lot of documents already in the database, it is a nightmare to open each document, edit it and save it.   Instead there is a short-cut to recalculate the computed fields.  Here is how:

Create an agent which would run Manually from the Actions Menu / Run Once.  In the formula for the agent, simply use the following @functions:

@Command([ToolsRefreshAllDocs])

or

@Command([ToolsRefreshSelectedDocs])

When this agent is run from the view, the former @Command will refresh all documents in the view and the latter will refresh only the selected documents in the view.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
notesrookieAuthor Commented:
Hey SysExpert,

That did the trick. I used the @Command([ToolsRefreshSelectedDocs]) and placed it in an action. Not sure why but I think I tried this in the past and it didn't work very well.

Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.