Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding documents using Formula

Status
Not open for further replies.

csiwa28

Programmer
Apr 12, 2001
177
Is there a way to find a document, open it and modify a field in that document using the Formula language
 
Setting the field of a different document is not that difficult, as long as you have a way of finding the document's UNID (Unique ID).

Here's some information straight from Lotus Help:

@SetDocField
Given the unique ID of a document, sets the value of a specific field on that document.
Syntax
@SetDocField( documentUNID ; fieldName ; newValue )
Parameters
documentUNID- Text. The unique ID of a document.
fieldName- Text. The name of a field on the document, enclosed in quotation marks. If you store the field name in a variable, omit the quotation marks here.
newValue- Text or text list; number or number list; time-date or time-date range. The value you want to give to the field.
Usage
This function does not work in column or selection formulas. @SetDocField is particularly useful in field, button, and agent formulas.

Understand that with this method, you don't even have to open the document you're modifying.

If you actually want to open the other form, once again you first need a way to get the UNID, and then you can use the following:


OpenDocument
Opens a document.
Syntax
@Command( [OpenDocument] ; writeOrReadOnly ; UNID ; width : height)
Parameters
writeOrReadOnly- Text ("1" or "0"). Optional. A value of "1" opens the document in edit mode. A value of "0" (the default) opens the document in read-only mode.
UNID- Number. Optional. The UNID (unique document ID) of the document you want to open. If you omit this parameter, Notes opens the currently selected document.
width : height - Number list. Optional. The width and height, in inches, of the window for the document you open. If you omit this parameter or use zero for either value, you create the window at the default size (usually the size that the last user set).

If you want to find the UID, there are different ways of doing this. That itself is difficult to explain in such a small area, so you'll have to check through help to find a particular ways of doing it that pertains to your database.

-MoGryph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top