@Functions on the Web

Several @functions are particularly useful in Web applications. However, some @functions are restricted.

  • Getting client information (@ClientType and @BrowserInfo)
  • Opening a URL (@URLOpen)
  • Getting the database name (@WebDbName)
  • Getting and setting request-header fields (@GetHTTPHeader and @SetHTTPHeader)
  • Getting the URL command (@UrlQueryString)
  • Manipulating the URL (@URLDecode and @URLEncode)
  • Field validation (@Failure and @Success)
  • Linking to the next and previous pages (@DbCommand)
  • Restricted @functions

Getting client information

The @ClientType function returns "Web" from a browser, "Notes" from a Notes client, and "None" from an agent. Here's an example of a computed text formula:

@If(@ClientType = "Web"; "You are running from a browser";
@ClientType = "Notes"; "You are running from a Notes client";
"You are not running from a browser or a Notes client")

The @BrowserInfo function returns information about a browser depending on the parameter value. The following example gets the browser type and platform if the user is running from a browser:

@If(@ClientType = "Web";
"You are running from a " + @BrowserInfo("BrowserType") +
"  browser on " + @BrowserInfo("Platform");
@ClientType = "Notes";
"You are running from a Notes client on " + @Platform;
"You are not running from a browser or a Notes client")

Opening a URL

The @URLOpen function opens the Web page specified by a URL. This example opens lotus.com:

@URLOpen("http://www.lotus.com")

In Web applications, you must specify the parameter. You cannot bring up the URL Open dialog box.

Getting the database name

The following formula gets the name of the current database and adjusts it for use in a URL:

@WebDbName

@WebDbName substitutes a forward slash for a back slash, and "%20" (hexadecimal 20) for a space. It is equivalent to:

@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName; -1);
"\\"; "/"); " "; "%20")
Note: @WebDbName is new with Release 6. Earlier releases require the formula with @DbName, @Subset, and @ReplaceSubstring.

Getting and setting request-header fields

The @GetHTTPHeader function returns the value of an HTTP request-header field. This example returns the value of the Host field:

@GetHTTPHeader("Host")

The @SetHTTPHeader function sets the value of an HTTP request-header field. This example sets the value of the Set-Cookie field:

@SetHTTPHeader("Set-Cookie"; "COOKIE1=4646")
Note: These @functions are new with Release 6.

Getting the URL command

The following formula returns in a text list the URL command responsible for the current page and any parameters:

@UrlQueryString

To get only the value of a parameter, specify the parameter name, for example:

@UrlQueryString("Category")
Note: This @function is new with Release 6.

Manipulating the URL format

@URLDecode and @URLEncode format any special characters in the URL, such as spaces or punctuation, so that the URL can be displayed as readable text or passed to a computer.

The following formula would return the readable text string "http://www.acme.com/4Q profit&loss":

@URLDecode ("Domino";"http://www.acme.com/4Q%20profit%26loss")

To return an encoded URL that can be used as an address, do not encode an entire URL, as that will remove necessary punctuation. Instead, encode only the final information, for example:

"http://www.acme.com/" + @URLEncode ("Domino";"4Q profit&loss")
Note: This @function is new with Release 6.

Field validation

@Success and @Failure work in field input validation formulas on the Web. The @Failure path causes the message specified as the parameter to appear on a new page. In the following validation formula, if the user fails to enter a value for RequiredField, the word "Gong" in bold appears on a new page:

@If(RequiredField = ""; @Failure("<B>Gong<\B>"); @Success)

You can make the failure page more meaningful by using more extensive HTML in the error message:

msg1 := "This is a required field.<br><br>";
msg2 := "<a href=/" + @WebDbName + "/Main+Document?OpenForm>";
msg3 := "Click here</a> to try again.";
msg := msg1 + msg2 + msg3;
@If(RequiredField = ""; @Failure(msg); @Success)

Linking to the next and previous pages

In a Web view, @DbCommand with "Domino" as the first parameter pages down and up:

@DbCommand("Domino"; "ViewNextPage")
@DbCommand("Domino"; "ViewPreviousPage")
Note: When called from an action on a page or document in a Web application, @DbCommand acts on an embedded view in the same page or document.

Restricted @functions

The following @functions do not work or are restricted on the Web.

@Function

Web restriction

@Certificate

Does not work on Web.

@DbColumn(ODBC)

Only works if the remote server is on the same machine as the Domino server.

@DbCommand

On Web only @DbCommand("Domino") is permitted.

@DbLookup(ODBC)

Only works if the remote server is on the same machine as the Domino server.

@DDEExecute

Does not work on Web.

@DDEInitiate

Does not work on Web.

@DDEPoke

Does not work on Web.

@DDETerminate

Does not work on Web.

@DeleteDocument

Does not work on Web.

@DialogBox

Does not work on Web.

@DocChildren

On Web only works in column formulas.

@DocDescendants

On Web only works in column formulas.

@DocLevel

Does not work on Web.

@DocLock

Does not work on Web.

@DocMark

Does not work on Web.

@DocNumber

On Web only works in column formulas.

@DocParentNumber

On Web only works in column formulas.

@DocSiblings

On Web only works in column formulas.

@Domain

Does not work on Web.

@EditECL

Does not work on Web.

@EditUserECL

Does not work on Web.

@Environment

Does not work on Web. (Use CGI variables instead.)

ENVIRONMENT

Does not work on Web. (Use CGI variables instead.)

@FontList

Does not work on Web.

@GetFocusTable

Does not work on Web.

@GetIMContactListGroupNames

Does not work on Web.

@GetPortsList

Does not work on Web.

@HardDeleteDocument

Does not work on Web.

@IsAgentEnabled

Does not work on Web.

@IsDocBeingMailed

Does not work on Web.

@IsEmbeddedInsideWCT

Does not work on Web.

@IsModalHelp

Does not work on Web.

@LaunchApp

Does not work on Web.

@MailDbName

Does not work on Web.

@MailEncryptSavedPreference

Does not work on Web.

@MailEncryptSentPreference

Does not work on Web.

@MailSavePreference

Does not work on Web.

@MailSend

[Encrypt] and [Sign] do not work on Web.

@MailSignPreference

Does not work on Web.

@PickList

Does not work on Web.

@Platform

On Web returns only the platform.

@Prompt

Does not work on Web.

@RefreshECL

Does not work on Web.

@Responses

Does not work on Web.

@SetEnvironment

Does not work on Web.

@StatusBar

Does not work on Web.

@TemplateVersion

Does not work on Web.

@UpdateFormulaContext

Does not work on Web.

@URLGetHeader

Does not work on Web.

@URLHistory

Does not work on Web.

@UserPrivileges

Does not work on Web.

@ViewShowThisUnread

Does not work on Web.