Solved

View acting strange

Posted on 2006-11-30
5
206 Views
Last Modified: 2013-12-18
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.
0
Comment
Question by:notesrookie
  • 2
  • 2
5 Comments
 

Author Comment

by:notesrookie
Comment Utility
Agent used:

Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
      
Set uidoc = workspace.CurrentDocument
Set uidoc = workspace.EditDocument( False )
Call uidoc.Close
0
 
LVL 18

Expert Comment

by:marilyng
Comment Utility
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
 
LVL 63

Expert Comment

by:SysExpert
Comment Utility
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
 
LVL 63

Accepted Solution

by:
SysExpert earned 250 total points
Comment Utility
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
 

Author Comment

by:notesrookie
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now