0
votes

I have a computed field abc(of type Number) which holds the time difference between two dates and I have used this formula @If(Start_time != "" & End_time != ""; @Round((ert - Untitled11)/ 3600) ; "0") ;

When I open the form, it shows me the difference in hours. Now I want the hours to be shown in a column in the view. Now in the column when I select the field as abc, it doesn't show any value in the column. What can I do to display the hours in the view column?

1
Did you save the documents after adding the field? Just adding them to the design does NOT add the information to the documents. You need to refresh the documents to actually containt the new item...Torsten Link
OK, I made an answer out of this comment...Torsten Link

1 Answers

2
votes

After adding a field to a form in designer it is not automatically added to the documents that had been created before the field existed.

To do the calculation and add the item to the documents you have to open and save all documents or write an agent to refresh existing documents.

This agent can be a Formula agent, running on target none.
Formula: @Command([ToolsRefreshSelectedDocs]) or @Command([ToolsRefreshAllDocs])

Or it could be a LotusScript- Agent running on target All selected documents.
Code:

Dim ses as New NotesSession
Dim db as NotesDatabase
Dim dc as NotesDocumentCollection
Dim doc as NotesDocument
Set db = ses.CurrentDatabase
Set dc = db.Unprocesseddocuments
Set doc = dc.GetFirstDocument
While not doc is Nothing
  Call doc.ComputeWithForm( False, False )
  Call doc.Save( True, True, True )
  Set doc = dc.GetNextDocument(dc)
Wend

After doing this, the item will be available in view columns.