分享知识、分享快乐

专注于企业业务流程管理平台;构建企业级协作和流程管理平台
目前博客已经迁往畅想网:
http://blog.vsharing.com/sharepoint
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Working with @Commands<forward>

Posted on 2007-01-08 22:04  kevinocean  阅读(534)  评论(0编辑  收藏  举报

@Commands represent all the actions you can "do" in a Notes client.

@Commands is that they are available only in places where UI code is allowed. For example, scheduled agents, agents run on a server, and Web agents are not allowed to have any UI-based functions, including @Commands.

Round 1: All @Commands go last

Listing 25-1: Round 1 @Command Execution Example

Start example

FIELD Status := "Sold";

FIELD Total := Units * Cost;

@Command([FileSave]);

@Command([FileCloseWindow]);

@Prompt([ok]; "New Doc"; "Opening new doc...");

@Command([Compose]; "04.01 EXAMPLE")

1. The status is set to Sold.

2. The Total is computed based on the values in the Units and Cost fields.

3. The document is saved.

4. The document is closed.

5. A prompt shows up telling you that a new document is being composed.

6. A new document is composed.

1. The status is set to Sold.

2. The Total is computed based on the values in the Units and Cost fields.

3. A prompt shows up telling you that a new document is being composed.

4. The document is saved.

5. The document is closed.

6. A new document is composed.

Executes after @functions

Executes Immediately

EditClear

Clear

EditProfile

EditProfileDocument

FileCloseWindow

CloseWindow

FileDatabaseDelete

DatabaseDelete

FileExit

ExitNotes

Folder

FolderDocuments

NavigateNext

NavNext

NavigateNextMain

NavNextMain

NavigateNextSelected

NavNextSelected

NavigateNextUnread

NavNextUnread

NavigatePrev

NavPrev

NavigatePrevMain

NavPrevMain

NavigatePrevSelected

NavPrevSelected

NavigatePrevUnread

NavPrevUnread

ReloadWindow

RefreshWindow

ToolsRunBackgroundMacros

RunScheduledAgents

ToolsRunMacro

RunAgent

ViewChange

SwitchView

ViewSwitchForm

SwitchForm

@Command([FileOpenDatabase]; server : database; view name; view key):

@Command([RefreshHideFormulas]) refreshes only the hide-when formulas on a document, not all the field values. This can be much more efficient than @Command([ViewRefresh-Fields]) if you have a complex document with many fields and hide-when formulas.

@Command([RunAgent]; agent name)

New Feature @Command([RunAgent]) is a new @Command in Notes/Domino 6.

@Command([RunAgent]) executes the agent named in the agent name parameter. [RunAgent] performs the same function as @Command([ToolsRunMacro]), except that [RunAgent] executes when it occurs inline in code, and [ToolsRunMacro] executes at the end of the code no matter where it occurs inline.

@Command([ToolsRunMacro]; agent name)

@Command([ViewRefreshFields])

@Command([ViewRefreshFields]) actually works in two places. If it is called from a view or folder, it refreshes the view or folder. If it is called from a document that is open in edit mode, it refreshes the fields and hide-when formulas in the document.

@Command([MailComposeMemo])

@Command([MailComposeMemo]) composes a mail memo from the user's mail database. Actually, [MailComposeMemo] composes the default form that is in the user's mail file. But unless the user has deliberately changed this, it is the Memo form.

@Command([OpenFrameset]; frameset name)

@Command([OpenPage]; page name)

@Command([OpenView]; view name):opens the specified view in the current database

@Command([RefreshFrame]; target frame name)

@Command([SwitchView]; view name)

New Feature @Command([RefreshFrame]) is a new @Command in Notes/Domino 6.

@Command([SwitchView]) opens the specified view in the current database. If you omit the view name parameter, the view selection dialog box is displayed. This can be handy for workflow applications.

[SwitchView] does the same thing as @Command([ViewChange]), except that it executes when it occurs in the code; [ViewChange] executes at the end of the code, regardless of where it occurs inline.

@Command([ToolsRefreshAllDocs]): This command refreshes all documents in the current view.

@Command([ToolsRefreshSelectedDocs]): This command refreshes all selected documents in the current view.

@PickList([Name] : [Single])

Using the Native OS Style property for dialog box fields

Dialog boxes cannot change in size while they are open. Notes style fields are allowed to dynamically expand to be able to display the entire content of the field. This can cause you problems if your user types in so much text that the field grows in size by a row or more, because some data will be hidden. To avoid this problem, set all your fields to the Native OS Style property. When this property is set, the field does not grow in size; instead, the field automatically displays a scrollbar if the amount of text entered exceeds the display capacity of the field.