@DbCommand (Domino® data source) (Formula Language)

Accesses view and folder information from a Domino® database in Web applications.

Note: This @function is new with Release 6.

Syntax

@DbCommand( "Domino®" ; "ViewNextPage" )

@DbCommand( "Domino®" ; "ViewPreviousPage" )

@DbCommand( "Domino®" ; "FolderList" ; promptString ; foldersToExclude )

Parameters

"Domino®"

String argument. Indicates that you want to access a Domino® data source.

"ViewNextPage"

String argument. Displays the next chunk of documents in an embedded view.

"ViewPreviousPage"

String argument. Displays the previous chunk of documents in an embedded view.

"FolderList"

String argument. Indicates that you want to display a list of the names of folders in the database that are accessible from the Web.

promptString

String. Optional. Use only if including "FolderList" string argument. String to display as the first choice in a Listbox field. If you want the first choice in the list to be "Select a folder," specify:

@DbCommand("Domino" ; "FolderList" ; "Select a folder")

foldersToExclude

Textlist. Optional. Use only if including "FolderList" string argument. Names of the folders you do not want to display in the listbox field. If you do not want the "MyStuff" and "Problems" folders to be included in the list, specify:

@DbCommand("Domino" ; "FolderList" ; "Select a folder" ; "MyStuff" : "Problems")

Usage

You cannot use this function to access a Domino® data source in the Notes® client.

Use the FolderList string argument with the @DbCommand in a selection formula for a Listbox field that is set to Use formula for choices to display a list of available folders in a Web application. If no folders exist, the Listbox field is empty when it displays and the promptString does not display in it either.

You can use the FolderDocuments @command with the FolderList string argument to copy or move a selected document in an embedded view that has HTML selection enabled into the folder selected from the Listbox field. To do so, complete these steps:

  1. Give the Listbox field that uses the @DbCommand the reserved name $$SelectDestFolder.
  2. Set the view that is being embedded into the form to Allow selection of documents on the Advanced tab of its View Properties box.
  3. Edit the EmbeddedView Properties box by setting the Display property on the Info tab to Using HTML and selecting Show Selection Margin on the Display tab.
  4. Add an action button to the form with the following formula: @Command([FolderDocuments];"";"0"). When clicked, the document currently selected in the embedded view is copied to the folder currently selected in the $$SelectDestFolder Listbox field. Replace "0" with "1" to move the selected document instead of copying it.

The "ViewNextPage" and "ViewPreviousPage" string arguments are useful when your form has an embedded view that contains several documents. By adding Next and Previous actions to the form that contains @DbCommand functions with these keywords, you can display the documents in manageable chunks. Set the Embedded View Properties box options as follows:

  1. Set the Web access Display setting to Using HTML.
  2. Deselect Use default.
  3. Select a number in the Lines to display field.

Examples

  1. This code, when added as the selection formula to a Listbox field that is set to Use formula for choices on the Control tab of the Field Properties box, displays a list of all the folders in a database. -Select a folder- appears as the first option in the resulting Listbox.
    @DbCommand("Domino";"FolderList";"-Select a folder-")

    If you name the Listbox field $$SelectDestFolder, the following code, when added to the "Move the Folder" action button, moves the document selected in the embedded HTML view into the folder selected from the Listbox field.

    @Command([FolderDocuments];"";"1")
  2. This code, when added as the selection formula to a Listbox field that is set to Use formula for choices on the Control tab of the Field Properties box, displays a list of the folders in the database. However, it prevents the "Private" and "Manager" folders from displaying in the resulting listbox.
    @DbCommand("Domino;"FolderList";"Choose a folder";"Private":"Manager")
  3. On a form that has an embedded view that contains 50 documents, this formula, when added as the code for the Next action button, displays documents 11-20 if the Lines to display field on the Info tab of the Embedded View Properties box is set to 10.
    @DbCommand("Domino";"ViewNextPage")

    You can also add an action button called Previous that contains the following code. When a user clicks this button, the previous block of pages displays in the embedded view.

    @DbCommand("Domino";"ViewPreviousPage")