@DbCommand Documentation

Hi!

I have a database that I inherited that uses the @DbCommand. I need to modify the code and have been looking all over the place for some kind of decent documentation on the formula. Can anyone point me in the right direction as to where I could get some info?

I found documentation on using ODBC with @DbCommand, but nothing for specifically Domino.

Here is the formula being used:

@DbCommand(“Domino”; “LoadAddressListByName”; NABs; “EntryList”; “20”; FindText);

Thank you in advance for you assistance!

Carrie Schroth

Subject: @DbCommand Documentation

Can you post more of your code so we can see the context it’s being used in. If it’s a Notes database you might not have to use the @DbCommand. You could probably use @DbColumn or @DbLookup.

Subject: RE: @DbCommand Documentation

Hi Alex!

This code is being used to pull names from our name & address book onto a web page into a select box. I am not sure that a @DbLookup/@DbColumn would work, since the number of values returned will be too many to put into a select box.

Carrie

Subject: RE: @DbCommand Documentation

Hope this documentation helps you:

@DbCommand(Type;Command; TargetNAB; fieldname; max#; SearchString);

This command is used in the lotus web client.

The command LoadAddressListByName allows for you to enter a string such as “A” to go to the

first name that matches or LoadAddressListByIndex to pull by number in view.

Code

Type - database to access, “Domino”

command - either “LoadAddressListByName” or “LoadAddressListByIndex”

TargetNAB -local address book on server “names.nsf”

Fieldname - fieldname in quotes of the field that will hold the address

selection list

max# - maximum entries to show in the list

search string / Index - If you use the “LoadAddressListByName” command then

the string placed here will cause the fuction to return the max entries

starting with the first match. other wise it’s the starting index in the

address book. great for paging through.

The value returned will be an html selection list.

The action to get the selected name uses the following command:

FIELD tmpSendto :=@Name([Abbreviate];tmpAddressList)

This will return the abbreviated name if a notes user or the internet mail

address for all others

the command will return all the persons and groups that are mail enabled from

the n&a

tmpAddressList is computed text field just used as a place holder.

Source url: http://searchdomino.techtarget.com/tip/1,289483,sid4_gci489202,00.html?FromTaxonomy=%2Fpr%2F283836

Subject: RE: @DbCommand Documentation

The Designer help database has this clearly documented - get famaliar with it if you are going to be doing notes development.

The database is usually located in help\help7_designer.nsf or you can access it via designer help\help topics.

Subject: RE: @DbCommand Documentation

Tom:

I live by the Designer help database and have been developing for several years. Unfortunately, I am working in Notes 6. The documentation for @DbCommand using “Domino” is lacking in version 6.

Thanks!

Carrie

Subject: RE: @DbCommand Documentation

Besides needing documentation, what is your question in regards to the @DBCommand?

This is pretty complete with examples from designer help:

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.

Subject: RE: @DbCommand Documentation

Tom:

Thanks for the information from the help file…The code that I have is below:

@DbCommand(“Domino”; “LoadAddressListByName”; NABs; “EntryList”; “20”; FindText);

This command pulls back names from our name and address book. I want to only pull back names with a certain field value.

This particular code does not seem to correspond with what the help provides. What would ‘LoadAddressListByName’ parameter be? I have figured out the other parameters, but not that one. I guess I am trying to figure out if the ‘LoadAddressListByName’ is a predefined parameter, or if this is just a unique folder/view defind by a previous developer.

I hope this makes sense.

Thanks!

Carrie

Subject: RE: @DbCommand Documentation

I would re-think what you are trying to accomplish. The LoadAddressListByName is a reserved word used by the @dbcommand.

I would probably create a categorized view by department or region or whatever and present the user with a picklist and allow them to pick it.

Or have a few forms and allow the user to first pick the department, then present them with another list of users in that department.