0
votes

I need to change the name and formula of columns of a embedded view in a lotus notes dialog box.I need to change this column name and formula when a combo box value in dialog box changes.i added the lotus script to change the column name and formula on combo box value change and added code to reopen the dialog box.

Dim w As New NotesUIWorkspace
Dim view As NotesView
Dim col As NotesViewColumn
Set view = db.GetView("Test")

For j= 0 To UBound(SboxColName)
    Set col=view.Columns(j)
    col.Title=SboxColName(j)
    col.Formula=SboxColFormula(j)
Next        

Call w.Viewrefresh()

But the view column not get updated in next open, it gets updated only when i open the view in designer and save the view. when i open this view in designer i can see that the column is updated in the design. Is there any way to get this embedded view column updated in runtime

1
what if 2 or more users will run your code for the same view simultaneously? - user784540
Yes, i know that is an issue when we change the design element in lotus notes. but i was thinking is there any solution for this by assuming one user is updating the design at a time - Nijeesh
Do your users have designer access to the database ? - umeli

1 Answers

0
votes

In past I used this code in server agent, has worked fine. I changed DateTime value in column for coloring rows (copy column and change formula). After that i had send command to rebuild view in db.

Set view = db.Getview(*viewName*)

Set clm = view.Columns(3)
Set Newclm = view.Copycolumn(clm, 5)
Call view.Refresh()
Newclm.Formula =  {@If( [} & Today & {] > @Date(DTContol); 255:0:0;-1 : -1 : -1 : -1 : -1 : -1)}
Call view.Removecolumn(4)

CommandText = {load updall } & db.Filepath & { -t } & view.Name & { -r}
Call session.Sendconsolecommand(db.Server, CommandText)

On Client: Maybe Call ws.Viewrefresh() will be sufficient