Solved

View acting strange

Posted on 2006-11-30
5
212 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
[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
  • 2
  • 2
5 Comments
 

Author Comment

by:notesrookie
ID: 18047542
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
ID: 18047707
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
ID: 18047908
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
ID: 18047919
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
ID: 18048051
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

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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.

738 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