Lotus notes formula Classification

Source: Internet
Author: User
Tags rounds
Access user environment

The user environment is a server or workstation that contains a database. The database includes the following content: copy a formula, a proxy triggered when a new email arrives or periodically, and select a formula or a column formula. Otherwise, the user environment is the Notes workstation where the user runs the formula.
The user Name can be either a private Name or a non-private Name. The private Name can be a standard or abbreviated Name. You can use @ Name to change the user Name format.
The following functions return or process information about the user environment.
Function Description
@ UserName: returns the UserName or server name.
@ Name ([key]; name) changes the user Name format. The keyword contains [CN] and resolves the public name from a private name. [Abbreviate] refers to a private name in the standard format. [Canonicalize] is opposite to the preceding one, [ToKeyword] sorts the parts of a name in reverse order and separate them with a backslash (used for classification view ).
@ UserRoles: for databases on the server, the list of roles of the current user is returned.
@ MailDbName: returns the server name and Path Name of the email database. This @ function calculates a list containing two elements.
@ OptimizeMailAddress (address) Remove useless network domains from the address.
@ Platform returns the Platform currently running by the user: Macintosh, NetWare, OS2V1, OS2V2, UNIX, Windows/16, or Windows/32.
@ Version returns the running Notes Version (string ).
@ Password (string) encrypts the string. After encryption, others cannot obtain the original string from it.

Access the current database and view

You can directly access the database that is running the formula (except the convenient icon because it does not have a database environment ). You can also directly access the view where the formula is being run in the view environment. Similarly, you can directly access the view of the open document in the document environment.
Database and view attributes
The following table lists the functions that return database and view attributes.
Function Description
@ DbManager: returns the users, groups, and servers with "Administrator" permissions on the database. Returns a list.
@ DbName: return the name of the current Notes server and database. Returns the list of two elements.
@ ViewTitle: returns the title of the current view.
Window title and column formula @ function
Many @ functions provide reply levels and other information about the view. In the view, the main document is numbered 1, 2, 3, and so on. Each group of reply documents or reply documents contains numbers starting from 1 at the second and third levels. By default, the complete reply document number is displayed in decimal form. For example, the second reply document of the Third Primary document is numbered 3.2, and the first reply document under it is numbered 3.2.1.
These functions only work in the window title and column formula, some of which will be limited. The return value is a string.
Function Description
@ Responses return the number of the reply document of the current document in the current view (only limited to the window title formula ).
@ DocLevel returns the current document level in the current view.
@ DocSiblings the document number (including the current document) at the same level as the current document is returned ).
@ DocNumber: return the number of the current document or category in the current view.
@ DocNumber (sep) is the same as above. Only sep is used instead of a period to separate numbers.
@ DocNumber ("") is the same as above, but only returns the rightmost part of the number.
@ DocParentNumber: return the number of the parent document or parent category of the current document or category in the current view.
@ DocParentNumber (sep) is the same as above. Only sep is used instead of periods to separate numbers.
@ DocParentNumber ("") is the same as above, but only the rightmost part of the number is returned.
@ DocDescendants returns the serial number of the subsequent document. Contains the sub-documents of the current document.
@ DocDescendants (def) is the same as above, and only def is returned. In def, use % to indicate the number.
@ DocDescendants (zero; def) is the same as above, but zero is returned if no subsequent documents exist.
@ DocDescendants (one, zero; def) is the same as above. If there is only one subsequent document, one is returned.
@ DocChildren: return the number of the direct sub-document of the current document.
@ DocChildren (def) is the same as above. Only def is returned. In def, use % to indicate the number.
@ DocChildren (zero; def) is the same as above. If no subsequent documents are available, zero is returned.
@ DocChildren (one, zero; def) is the same as above. If there is only one subsequent document, one is returned.
@ IsCategory if any field on the right of the current field of the current row is a category, an asterisk is returned.
@ IsCategory (True) is the same as above, but the returned Frue replaces the asterisk.
@ IsCategory (True; False) is the same as above, but if there is no category field, False is returned.
@ IsExpandable if the current row is expandable, a plus sign is returned.
@ IsExpandable (True) is the same as above, but returns True instead of the plus sign.
@ IsExpandable (True; False) is the same as above. If the current row cannot be expanded, False is returned.

Use @ function to access external database through LS: DO

The following @ function accesses the external database through ODBC and returns a list of values or values:
@ DbColumn: return all values in a column of the table, or all different values.
@ DbLookup: a column in the returned table matches the selected value with a keyword.
@ DbCommand: it passes a command to an external database management system (DBMS) and returns the result.
Both @ DbColumn and @ DbLookup can only extract data. They cannot add, delete, modify data, or perform other operations. @ DbCommand can extract data or send other SQL statements that can change data. Lotus script provides more powerful functions including updating external databases.
The first four parameters are the same for the three functions, and the database is accessed through ODBC. These parameters are:
"ODBC" is a character constant; or "ODBC": "NoCache"
Define the name of the data source in the data source table (ODBC. INI in Windows)
User Identifier, a list of two user identifiers, or an empty string, depending on the external data source
Password, a list of two passwords, or an empty string, depending on the external data source
(@ DbColumn and @ DbLookup) Name of the table to be accessed
(@ DbCommand) command to be executed
(@ DbColumn and @ DbLookup) Name of the column to be accessed
Option for processing NULL data returned by the data source
(@ DbLookup) Name of the column containing the keyword
(@ DbLookup) a keyword value of the appropriate data type, or a list
(@ DbColumn and @ DbLookup) List of two elements: "Distinct" as a keyword or empty string; "Ascending" or "Descending" as a keyword
To use IDS and passwords, you can specify empty strings and provide them when you execute functions.

Use @ function to access external database through LS: DO

1. This formula is used to obtain the PARTNO column in the MANUAL table.
@ DbColumn ("ODBC"; "Oracle"; "MANUALS"; "PARTNO"; "": "Ascending ")
2. This formula obtains the TITLE from the row of the MANUALS table. In this row, PARTNO is 17-895A.
@ DbLookup ("ODBC"; "Oracle"; "MANUALS"; "TITLE"; "PARTNO"; "17-895A ")
3. This formula gets the PARTNO column value from each row where the number value of the ONHAND column in the MANUALS table is less than 100.
@ DbCommand ("ODBC"; "Oracle"; "select partno from manuals where onhand <100 ")

Convert Data Types

The data operation type must be correct. The following functions are used to convert data and test data types.
Function Description
@ Text (value) converts a value to a Text string.
@ Text (value; format) converts a number or time-date value to a Text string based on the specified format.
@ TextToNumber (string) converts a text string into a number.
@ TextToTime (string) converts a text string into a date-time value.
@ IsText (value) if the value is a text string or a list of text strings, return the "true" value (1 ).
@ IsNumber (value) if the value is a list of numbers or numbers, return the "true" value (1 ).
@ IsTime (value) If a value is a time-date or time-date list, the return value is "true" (1 ).
@ Char (number) converts the code of an IBM code page 850 to a corresponding character.

Connection, comparison, and determination Length

Operator + is used to connect strings. Operator =, <> ;,! =, =! , >;<<,>;,<=And >;= is used to compare strings. The following functions are used to determine the length of a string and compare a string:
Function Description and usage
@ Length (string) returns the Length of a string in characters.
@ Length (stringlist) returns the Length of each element in the string list in characters.
@ Matches (string; pattern) determines whether the two strings match. You can use wildcards to extend the comparison range.
@ Like (string; pattern) determines whether the two strings match. Complies with ansi SQL standards.
@ Like (string; pattern; esc) is the same as above, but only one escape character is added.
@ Matches @ Use "?" For Matches To match any single character, and use "*" to match any character sequence. @ Matches uses "\" as the escape character.
@ Like follows ANSI X3.135-1992 standards and uses '_' (underline) to match any single character, '%' (percent) to match any character sequence.

Search for and extract substrings

Example
The following functions search for and extract substrings:
Function Description
@ Contains (string; sub) determines whether a string Contains a substring.
@ Contains (string; list) determines whether a string Contains a substring in the list.
@ Begins (string; sub) determines whether a string starts with a substring.
@ Ends (string; sub) determines whether a string Ends with a substring.
@ Left (string; n) extract the leftmost n characters from a string.
@ Left (string; sub) extracts leftmost characters from a string until a substring is searched from Left to right.
@ LeftBack (string; n) extracts the leftmost character from a string until the nth character starts from the right.
@ LeftBack (string; sub) extracts the leftmost character from a string until a substring is searched from right to left.
@ Right (string; n) extract the rightmost n characters from a string.
@ Right (string; sub) extracts the rightmost character from a string until a substring is searched from left to Right.
@ RightBack (string; n) extracts the rightmost character from a string until the nth character starts from the left.
@ RightBack (string; sub) extracts the rightmost character from a string until a substring is searched from left to right.
@ Middle (string; off; n) extract n characters from a string, start with an offset, and search from left to right.
@ Middle (string; sub; n) extracts n characters from a string, starts from the substring, and searches from left to right.
@ Middle (string; off; sub) extracts characters from a string, starting from an offset, ending with a substring, and searching from left to right.
@ Middle (string; sub) extracts characters from a string, starts from the substring, ends with the end of the substring, and searches from left to right.
@ MiddleBack (str; off; n) extracts n characters from a string, starting from an offset and searching from right to left.
@ MiddleBack (str; sub; n) extracts n characters from a string and searches from right to left from the substring.
@ MiddleBack (str; off; sub) extracts characters from a string, starting from an offset, ending with a substring, and searching from right to left.
@ MiddleBack (str; sub) extracts characters from a string, starting from a substring, ending with another substring, and searching from right to left.
@ ReplaceSubstring (source; from; to) Replace the content of to with the content of from in source. If both from and to are lists, replace the corresponding items in order.
@ Word (string; sep; n) extract Word n from string, where Word is text between the specified separator.
@ Word (list; sep; n) extracts Word n from each string in the list, where Word is the text between the specified separator.

Trim, repeat, add new rows, and change the case

Example
The following functions trim strings, duplicate characters, add new lines (Press ENTER), and change the case:
Function Description
@ Trim (string) removes leading, ending, and unnecessary spaces from the string.
@ Trim (list) removes spaces at the beginning, end, and end of each element in the string list, and removes blank elements from the list.
@ Repeat (string, number) repeats the string several times.
@ NewLine Insert a new line in the text string (Press ENTER ).
@ LowerCase (string) converts all uppercase characters in the string to LowerCase.
@ UpperCase (string) converts all lowercase characters in the string to UpperCase.
@ ProperCase: converts the first character of each word in a string to uppercase, and converts the remaining characters to lowercase letters.

Perform arithmetic operations

Multiplication, division, addition, and subtraction operators (*/+ -). Multiplication and division operators take precedence over addition and subtraction. The order of operation is from left to right. However, you can use parentheses to change the operation sequence. The following lists arithmetic functions.
Function Description
@ Abs (number) calculates the absolute (unsigned) value of a number.
@ Sign (number) returns 1 for positive numbers,-1 for negative numbers, and 0 for zero.
@ Sum (num;...) calculates the Sum of the number and number list.
@ Integer (number) removes the decimal part of the number to make it an Integer.
@ Integer (numlist) removes the fractional part of all elements in the number list and converts them into integers.
@ Round (number) rounds a number.
@ Round (number; factor) Regularization number with a specified factor.
@ Round (numlist) rounds each number in the number list.
@ Round (numlist; factor) Normalization of each element in the number list with a specified factor.
@ Max (number; number) is the larger of the two numbers.
@ Max (numlist; numlist) when you perform a matrix operation on the two numeric lists, take the larger one of the two numbers.
@ Min (number; number) takes a smaller value of two numbers.
@ Min (numlist; numlist) When performing a matrix operation on the two numeric lists, take the smaller one of the two numbers.
@ Modulo (number; number) calculates the remainder of a number after it is divided by the second number.
@ Modulo (numlist; numlist) Calculate the remainder of a number after it is divided by the second number when two numeric lists are matrix.
@ Power (base; exp) exponential computation.
@ Sqrt (number) calculates the square root.
@ Pi: Obtain the circumference rate.
@ Log (number) is used to calculate the base-10 logarithm.
@ Ln (number) calculates the natural (base on e) logarithm.
@ Exp (number) calculates the base e index.
@ Random returns a Random number between 0 and 1.
@ Sin (angle) returns the sine (radian) of the angle ).
@ Cos (angle) returns the cosine (radians) of the angle ).
@ Tan (angle) returns the tangent of the angle (radians ).
@ Asin (sine) returns the arcsin function.
@ Acos (cosine) Inverse cosine function.
@ Atan (tangent) returns the arc tangent function.
@ Atan2 (x; y) calculates the arc tangent function with y/x as the tangent value.

Formula of the reply Column

Only the columns used for reply require formulas to generate the text of the summary reply document.
Contains the author's Information
To discuss the database, you can use the formula in the following reply column to display the author, date, and topic of the reply document:
From + "added this comment:" + Subject + "(" + @ Text (@ Created) + ")"
Display the reply as follows:
Stephen Mahar added this comment: Great job! (10/10/97 04:43:15)
Tracking Document Status
In the employee information database, the response column displays the survey information for new and resigned employees as the response document for the general "employee records" in the "by employee name" view. The following formula displays different messages based on the forms used in the reply document and the document's delivery status.
@ If (Form = "Exit"; "Exit Form,"; "New Hire Information,") + @ If (Mailed = "Yes "; "mailed to employee" + @ Text (@ Date (PostedDate); "not yet mailed ")
If the reply document uses the Exit form, the reply line may be displayed as follows:
Exit Form, mailed to employee 08/26/97
If the reply document uses the New Hire Information form, the reply line may be displayed as follows:
New Hire Information, not yet mailed
Number of follow-up replies
You can use @ DocDescendants to track the number of reply documents so that the author can quickly know the number of replies received. The formula below for the primary document column (not the reply column) is very useful for the view of the reply style.
Subject + "(" + @ Name ([CN]; From) + @ DocDescendants (")"; ", % response)"; ", % responses )")
If it is the main document, the column displays the content of the Subject domain, the author name, the number of replies, and the number of replies to the document. If the document has a reply, "response" is displayed in the column; otherwise, "responses" is displayed ". The main document line can be displayed as follows:
Need Help with Trade Show (Indy Montoya, 1 response)
Changing the Product Name (Sandy Braun, 2 responses)

View applet Programming

You can use some @ commands to program view applets. Run the following command:
@ Command description
ViewCollapse collapse selected document
ViewExpand expand the selected document
ViewCollapseAll collapse all documents
ViewExpandAll expand all documents
ViewRefreshFields refresh the view.
When refreshing, the view applet does not delete the document marked as deleted
MoveToTrash: Mark the selected document as deleted
EmptyTrash permanently deletes a document marked as deleted
Folder move or copy the selected document to a Folder
RemoveFromFolder deletes the selected document from the current folder.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.