Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

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.
0
notesrookie
Asked:
notesrookie
  • 2
  • 2
1 Solution
 
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now