Lotus Notes common method

xiaoxiao2021-03-06  56

Convert the date to a day

REM "this form"; Rem "OtherWise It Gives The" IncorRect Data Type ... "Error."

M: = @Text); N: = "1": "2": "3": "4": "5": "6": "7"; days: = "sunday" : "Monday": "Tuesday": "Thursday": "Friday": "saturday"; dayName: = @Replace (m; n; days); @ text (date) "(" dayname ")"

How to calculate a date in the year is the first week

Some Applications Require The Computation of The Week Number in A Month in Which a Given Date Falls. For Example, Sunday 02 May 1999 Is in The Second Week While Saturday 01 May 1999 Is in The First Week.

This Formula Computes The Week Number of Date Value Givendate:

WeekNumber: = @Iteger ((@Day (givendate) - @Weekday (Givendate) 13) / 7)

Calculate the number of months between two dates

Date1: = "

07/22/99

"; DATE2: =" 12/22/98 "; mnth: = ((@yxtotime (date2)) - @year (@TextTotime (date1))) * 12) @Month (@texttotime (date2) ) - @Month (@TextTotime (date1)); @ABS (mnth)

How to convert data into a phone number format

Phone: = @trim (Field Name); Phonested: = @Trim (@Lowercase (Phone); "ET- () ./ "); "")); @ens (@LENGTH) Phonested) = 10; "(" @LEFT (Phonestripped; 3) ")" @Right (@Lestripped; 6); 3) "-" @right (phoneStripped; 4); phone

Convert two ages into four ages

A: = [

1/1/99

]; @Prompt ([OK]; "Date"; @ text (a; "d2") "/" @ text (@Year (a))) Another method is:

@Text (; "D2") "/" @ text (@Year ())

Sometimes everyone wants to modify the prompt sound when new mail, can do this: 1. Add a line in the Notes.ini file, newMailTune = ***, such as: newMailTune = C: /CoolSound.wav2. Save Notes.ini.3. Restart Notes You can find that the prompt of the new message is changed to the effect of CoolSound.

How to limit who can run agency in the program

Rem "============================================="; Rem "Restricts Who Can Can Run this agent to those IN at Least One of the Specified Role (s). Note That 'Enforce a Consistent ACL' MUST BE Enabled for @USERROLES TO WORK LOCALLY. "; _ roles: =" [admin] "; remote ======= ====================================== "; _ allowedtorunagents: = (_roles = @USERROLES); @ IF (_Allowedtorunagents;"; @ Return (@Prompt ([OK]; "Launch Agent"; "You are not authorized to run agent on this database. Contact your database administrator if you need to run system agent on this database.")); Rem "the Normal Agent Code Follows ... ";

How to run the DOS command with formula: @Command ([EXECUTE]; "c: //command.com"; "/ C

Del

C: //test.txt ")

How to calculate the working day between two dates

This Formula Calculates Elapsed Working Days, Excluding Saturday and Sunday, Between Any Two Dates (fromDate and Todate).

TotalDays: = (400 * 24)) 1; Extday: = @WeekDay (fromDate) - 1 (7 - @WeekDay (Todate)); Totweekday: = (TotalDays - ExtDay) - 2 Totsatsun: = (TotweekDay / 7) * 2; ELAPSED: = Extday (TotweekDay - Totsatsun); Finalelapsed: = @if (@LEXT (@Text (ELAPSED); ".")! = "; @LEFT @Text (ELAPSED 1); "."); ELAPSED; FINALELAPSED segment code for the web login button

Here is the code for a login button for a Web application that permits Anonymous access. Simple create a hidden agent with this LotusScript code. Then use a button to call the agent. For example, if your agent is called "(Login)", You Would Call It with this form: @command: @command ([Toolsrunmacro]; ") SET The Button to Hide-when The username is" anonymous ". Finally, if The Application Uses frames, you may want to set the button to open in a new window to avoid nesting a frameset within a frameset.CodeCode for the agent: Sub InitializeDim db As NotesdatabaseDim session As New NotesSessionSet db = session.CurrentDatabaseDim servername As New notesname (db.Server) Dim vEvaluate As VariantDim dbWebPath As Stringvevaluate = evAlate (| "/" @SUBSET (@dbname; -1); ""; "/") "/"; |) dbWebPath = vevaluate (0) print "[http: //" Servername.common DBWebPath ? OpenDatabase & login " "] "End Sub

@ Function.lss usage method

The .lss file show a few @functions, which have been implemented in Lotus Script.any .lss file can referenced in a Lotusscript Library by adding line as shown below to the declarations section of the script library.% INCLUDE "@ function.lss "This tip is used to set up a web-based view of the web. Code: @Implode (@ExPlode (Your Field Here); ") To elaborate on this concepter (Manufacturer; ""; 1): @Word (Manufacturer; ""; 2)); "") "" @ Right (@Right (Manufacturer; ");" ")

How to hide the menu when opening a form

You can hide the menu bar what is normally displayed with a given form.

While In Form Design, Press Ctrl Shift (Hold Down Ctrl and Shift, And Press The "Plus" Key). Save the form. This is a toggle key. When Pressed, a formrty flag called "Nomenus" is Placed in $ INFO.

To Disable The No-Menu Mode, Open The The Form Design, Press Ctrl Shift And Save The Form. This Removes The Form ProPery Flag "Nomenus" from the $ info field.

THE ONLY WAY to DETERMINE THE NO-MENUS MODE OF A FORM IS To Manually Inspect The Contents of The $ Info Field

How to introduce a column value of other views in the column of the view

Occasionally, it's helpful to be able to create a view column that takes advantage of the calculations already done in other view columns. Let's suppose you have a number in column A, and a number in column B, one or both of which is calculated by a formula in the view column. you want to display their total in column C without having to repeat any complex formulas. there's a little known feature that will let you do this. in the propeller head tab of the view column properties, there's a field that'll let you enter a column name. For a formula column, Domino Designer will automatically generate a name such as "$ 5." to use the value from this column in other columns, you need to change this to a name that's a legal Variable, EG "Columna." After Giving Names To Column A and B, You Can Write The Formula For Column C As Follows. Code Columna Columnb Time Array Process: When You NEED TO CREATE A LIST OF Dates, BASED ON A Begin Date and an end Date. this is extremely useful when Creating Calendar Views, Allowing You to Display Activities That Extend Over A Single Day. Requirements - Three Fields: BeGindate

EnddatedArrayPlace

the code in the query save event, and when the document is saved it will populate the DateArray field with a list of dates. Dim session As New NotesSessionDim db As NotesDatabaseDim workspace As New NotesUIWorkspaceDim currentdoc As NotesDocumentDim uidoc As NotesUIDocumentDim doc As NotesDocumentSet db = session .CurrentDatabase Set uidoc = workspace.currentdocumentSet doc = uidoc.documentIf doc.BeginDate (0) = doc.EndDate (0) Thendoc.DateArray = doc.BeginDate (0) Elseresult = doc.BeginDate (0) & | - | & doc .Enddate (0) Result2 = evuate (@TextTotime)) |) Doc.dateArray = Result2END ifcall doc.save (true, false) How to verify that the domain fills in the email address is correct

Domain: = @rightback (email; ""); @ IF (@trim (email) = "|! @contains (email;" @ ") | @LENGTH (Domain) <2 | @ley (domain)> 3 | (@Lower (Domain) = 3 & @member (@Lowercase (Domain); "COM": "ORG": "Net": "GOV": "mil": "int") = 0 ) | @Trim (@LEFT (@ ")) =" "@failure (" a Valid Internet E-mailure ("a Valid Internet E-mailure (" a Valid Internet E-mailure ("a Valid Internet E-mailure (" a Valid Internet E-mailure ("a Valid Internet E-mailure (" a Valid Internet E-mailure ("A Valid Internet E-mailure (" A Valid Internet E-mailure ("a Valid Internet E-mailure (" A Valid Internet E-mailure ("A Valid Internet E-mailure (" a Valid Internet E-mailure ("a Valid Internet E-mailure (" A Valid Internet E-mailure ("A Valid Internet E-mailure" @SuCcess)

Locate the character in the character list

Field - list = Your Input Listfield - Findchar = The Thing You're Trying to find in the listfield - position = Multi Value Field with final position of the characters you're looking for.

Button Code Used to Find The position of all of your character.

NuminList: @Elements (list); targetfindlist: = @ExPlode (@repeat) findchar); seqlist: = @text (@Texttonumber (("0": "1": "2": "3": "4": "6": "7": "8": "9") * ("0": "1": "2": "3" : "4": "5": "6": "8": "9"))); SEQ: = @Subset (@SUBSET; -99); NuminList); altfindlist: = LIST Seq; alttargetfindlist: = targetfindlist seq; findpos: = @Replace (altfindlist; alttargetfindlist; seq); final: = @trim (@Replace (findpos; altfindlist; ")); @ setfield (" position "; @ Trim (@Replace (allfindlist; "))) How to display the content in the RTF in the view

Have you ever wanted to display the contents of rich text fields in a view For example:? You want to let your users be able to bold and set the fonts for their comments, but you also want to have these comments appear in a view.

Here's a soling. On the form, if the rich text field name is body, create a hidden, computed text field (for example, call it bodytext) with the Following Value:

@Abstract ([TEXTONLY]: [TrimWhite]; 64000; ""; "Body")

You kil display the body text field in views!

How to dynamically access other databases

This tip uses the profile extensively or you can create a separateprofile form available in a separate view. The view name is "Profile" with one column that is sorted. The value shown in the column is theform name or a default value Profile ". On The Profile Form Create Four Text Fields: Server Database View Key

On The Form You NEED TO Recover A List of Keywords That Are Availablein The Second Database. Place The Following Code on The Keyword Fieldwith The Following Properties Set: USE Formula For Choices

The Following Properties Can Be Set As Required: Refresh Fields on KEYWORD CHANGE Refresh Choices on Document Refresh

In The Lookup Formula Place The Following Code:

SRV: = @ dblookup ("notes": "nocache"; "profile"; "profile"; "servername"); db: = @ dblookup ("notes": "Nocache"; "Profile" "Profile"; "Database"); VW: = @ dblookup ("notes": "nocache"; "profile;" profile "; ky: = @ dblookup (" notes ": "Nocache"; "profile"; "profile"; "key"); @ dblookup ("notes": "nocache"; SRV: DB; vw; ky; )

The Last DBlookup Can Be Replaced with a dbcolumn also. The fieldname / column number can also be picked up from the profile.

An enhancement to this could be used the profiles availealso eg .:

@Getprofilefield

转载请注明原文地址:https://www.9cbs.com/read-90113.html

New Post(0)