2007-10-25

Notes: Insert a DocLink into a Rich Text Field while editing the document (without the need of saving it)

There's a lotus script solution for this but it will cause a Replication Conflict if the document locking functionality is active on the database.

So, an alternative is to have a page with an embedded view showing the documents list from where the user will choose the document to link to, and then call this page on a dialog box.
On the page's QueryClose event, add this:

@Command([EditMakeDocLink])

And on the form where the RichTextField is, add a button or an Action with a formula similar to this:

@DialogBox( "pg_name" ; [AutoHorzFit] : [AutoVertFit] : [NoNewFields] :
[NoFieldUpdate] : [SizeToTable] : [ReadOnly] ; "Insert Doc Link" );
@Do
( @PostedCommand([EditGotoField];"rtf_field_name");
@PostedCommand([EditInsertText]; @NewLine);
@PostedCommand([EditInsertText]; "Document link: ");
@PostedCommand([EditInsertText]; @NewLine);
@PostedCommand([EditInsertText]; @NewLine);
@PostedCommand([EditLeft];"2"); @PostedCommand([EditPaste]))

Notes: View Entry's ColumnValues returns an array for a specific column

This will happen if the column's property "Show multiple values as selected entries" is selected.

In this case the ColumnValues property of the NotesViewEntry class, will return an Array and the common way of obtaining it's value will fail.

To access the entry's column value weather it's an array or not, use this:


Function getColValue (vCol As Variant) As String
If Isarray(vCol) Then
getColValue = Cstr(vCol(0))
Else
getColValue = Cstr(vCol)
End If
End Function

And then use it like this:

stringValue = getColValue(vwEntry.ColumnValues(1))

2007-10-03

Notes: Scheduled agents on server

If you want to run (for troubleshoot purposes, for instance) an agent directly on a server, with the server's id, and you have no access to the machine, just run it from the web:

http://your_server/your_db_path/your_db/your_agent?openAgent

Now just go to the server's log to check for debug and/or error messages.