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]))

No comments:

Post a Comment