Showing posts with label Lotus Notes. Show all posts
Showing posts with label Lotus Notes. Show all posts

Friday, January 31, 2014

lotus formula to Extract One Value from Text List.

Extract 1 Value from Text List:
Normally when trying to extract a particular value from a text list, you would use Script and extract the value with the array(index), but there is a simple way to do this with formula language For this to work, you must know which value you wish to retrieve, ie.. what number the value is in the list. Use @Subset to get your desired results. This example uses a nested @Subset with another @Subset.

For example:
If the field you are wanting to extract the value from is, Rakesh, Sunny, Bhavin, Rajesh, Jathin, Kuti and you want to extract the value "Rajesh" from the list, use the following in another field:
Eg:
Here fieldname is Friends
@Subset(@Subset(Friends;4);-1)

This first gets the value of the first 4 entries in the list, then extracts the last value from that list giving you the desired result "Rajesh", since Rajesh is the 4th value in the 1st list, and the last in the second.

Find the position of text Value in Text List:

Here, you can use @Member(value ; list) lotus notes formula function. That determines the position of a value in a string list.

Eg:
position := @Member("Rajesh";Friends)

This formula will return no 4 to the "position" variable.

Saturday, January 11, 2014

Refresh Lotus Notes Document with LotusScript


Will work for Refreshing the document.
Below script will (Open -> Edit - Save-> Close) the selected document from the view.

Sub Click(Source As Button)
Dim session As New NotesSession 
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument 
Dim ws As New NotesUIWorkspace 

Dim j As Integer

Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments

For j = 1 To collection.Count
Set doc = collection.GetNthDocument( j )
Set uidoc = ws.EditDocument(True,doc)
Call uidoc.Refresh
Call uidoc.Save 
Call uidoc.Close 
Next
End Sub

Thursday, December 19, 2013

Action button to set Date Value with Lotus Notes Formula Language

A quick and dirty way for doing this. No error checking, big assumptions about the input to the prompt being right.

1
2
3
4
5
nd := @Prompt([OKCANCELEDIT]; "Enter the New Date"; "YYYY/MM/DD."; @Today);
@If (nd ="";@Return("");"");
y := @Left (nd;"/");
m := @Left(@Right (nd;"/");"/");
d:= @right(@Right (nd;"/");"/");
1
2
FIELD DateFieldOnForm := @Date(@TextToNumber (y) ;@TextToNumber ( m)
;@TextToNumber ( d) )
The better, clean, way would be to use LotusScript and open a form in Dialog box mode, the form having a Calender tool on it.

Monday, May 13, 2013

AutoSend the mail from excelsheet


Create a Action Button and copy paste following Lotus Script.
When you click on action button it will open excel file.. add following columns and once your are done click "OK" Prompt button...

This is select individual rows and send mail.

Columns 1: To
Columns 2: Subject
Columns 3: Body Content

Programming Code:


Sub Click(Source As Button)
on error goto ErrorHandling

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim richStyle As NotesRichTextStyle
Dim color As NotesColorObject

Dim xlApp As Variant
Dim xlsheet As Variant
Dim ARangeValue As Variant

Dim I As Integer
Dim c As Integer 
Dim j As Integer
Dim answer As Integer

Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set richStyle = session.CreateRichTextStyle
Set color = session.CreateColorObject
color.NotesColor = 240

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.add

Set xlsheet = xlApp.Workbooks(1).Worksheets(1)
xlsheet.Activate

Messagebox " Copy the data in the excelsheet, Once you click 'OK' mail will sent to the respected users."


c=65
While Not xlsheet.Range(Chr(c) & "1").Value = ""
i=2

doc.Form = "Memo"
doc.SendTo = xlsheet.Range("A" & Trim(Str(i + 1))).Value
doc.Subject = xlsheet.Range("B" & Trim(Str(i + 1))).Value

Dim richText As New NotesRichTextItem(doc, "Body")

Call richText.AddNewline(1)

richStyle.Bold = True
richStyle.NotesColor = COLOR_BLUE
richStyle.FontSize = 18

Call richText.AppendStyle(richStyle)
Call richText.AppendText("Title with Tex Style")

richStyle.Bold = False
richStyle.FontSize = 10
richStyle.NotesColor = COLOR_BLACK

Call richText.AppendStyle(richStyle)
Call richText.AddNewline(2)
Call richText.AppendText("Body Contents for the mail....")
Call doc.Save(True, False)
Call doc.Send( False ) 

i = i + 1
Wend

Messagebox "Auto Mail send Process is Complited"

Exit Sub
ErrorHandling:
Messagebox  Error

End Sub 


Tuesday, May 22, 2012

Wrong Mail address reflecting in email address lookup while drafting mails


People find issue with the Lotus Notes 8.x when they draft the eMail. They get automatic list name that they have wrongly added, in there past mails. 


Solution for this issue is you need to clear your recent contact from your address book, or you can disable this feature.


Recent Contacts feature can be disabled using any of the following methods: 


1. Use the following parameter in the client's notes.ini file: 
DisableDPABProcessing=1 


2. Make changes in the Contacts section of the user preferences: 
- Select File --> Preferences. 
Choose Contacts on the left 
- Select "Do not automatically add names to the Recent Contacts view" on the right. 


3. Switch to Notes Basic type-ahead: 
In the main Notes menu, select File --> Preferences. 
Choose Basic Notes Client Configuration on the left. 
In the additional options, check "Disable type-ahead for all name fields and use the Notes Basic type-ahead". 


This reverts the type-ahead feature back to the Notes V6 and V7 type-ahead functionality and does not pull entries from the Recent Contacts view. 


You can also implement this change using a Desktop policy on the Preferences --> Miscellaneous tab. The setting is "Disable type-ahead for all name fields and use the Notes Basic type-ahead".



Note: These methods will prevent new entries from being added to the Recent Contacts view. If you already have existing Recent Contacts, they will continue to be suggested by type-ahead unless you delete the contents of the Recent Contacts view. 

Friday, June 10, 2011

Refresh Document by Lotus Script



'Global Declaration
Declare Sub keybd_event Lib "user32.dll" (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer,Byval dwExtraInfo As Integer)
         

Sub RefreshDoc
            Const VK_F9 = &H78

            Const KEYEVENTF_KEYDOWN = &H0
            Const KEYEVENTF_KEYUP = &H2

'Command line same as Press and release F9
            keybd_event VK_F9, 0 , KEYEVENTF_KEYDOWN , 0
            keybd_event VK_F9, 0 , KEYEVENTF_KEYUP , 0

End Sub



Tuesday, April 26, 2011

New @commands that execute as soon as they are encountered in a formula on left with corresponding existing @command on right.

Clear - EditClear
CloseWindow - FileCloseWindow
DatabaseDelete - FileDatabaseDelete
EditProfileDocument - EditProfile
ExitNotes - FileExit
FolderDocuments - Folder
NavNext - NavigateNext
NavNextMain - NavigateNextMain
NavNextSelected - NavigateNextSelected
NavNextUnread - NavigateNextUnread
NavPrev - NavigatePrev
NavPrevMain - NavigatePrevMain
NavPrevSelected - NavigatePrevSelected
NavPrevUnread - NavigatePrevUnread
RefreshWindow - ReloadWindow
RunAgent - ToolsRunMacro
RunScheduledAgents -ToolsRunBackgroundMacros
SwitchForm – ViewSwitchForm
SwitchView - ViewChange




Thursday, December 23, 2010

Create Excel Report

Sub ExcelReport()



' Prepare MS Excel for work
Set xlApp = CreateObject("Excel.Application")


' View Excel object 
      xlApp.Visible = True


' Add new Workbook to excel sheet.
xlApp.Workbooks.add
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)


' Select the Sheet1 and rename it what ever your want...
xlsheet.Activate
xlsheet.Name = "[Sheet Name]"

' Add values/formulas to excel Cells...


xlSheet.Range("A1").Value = "No"
xlSheet.Range("B1").Value = "Name"
xlSheet.Range("B1").Value = "Value"


xlSheet.Range("A2").Value = "1"
xlSheet.Range("A3").Value = "2"
xlSheet.Range("A4").Value = "3"


xlSheet.Range("B2").Value = "ABC"
xlSheet.Range("B3").Value = "PQR"
xlSheet.Range("B4").Value = "XYZ"



xlSheet.Range("C2").Value = "100"
xlSheet.Range("C3").Value = "200"
xlSheet.Range("C4").Value = "300"

xlSheet.Range("B5").Value = "Total Value"
xlSheet.Range("C5").Value = "=Sum(C2:C4)"


End Sub

Removing unused field names from your Notes application design.



Hello Developers,


If you have been doing Notes development for any length of time, you have run into this situation.  Coping an existing application as a starting point for a new app, change the form design, go to create a new view, and your list of field names to select from has both sets of field names from both apps.  And a worst case scenario appear, you end up with a damaged design because you have too many unique field names or the length of all the field names is larger than supported by Notes.  You do a search on discussion forums and find instructions on how to remove unused field names, but for some reason they don't quite work.  That's certainly been my lot in life with this process...
I found the following Knowledgebase item the other day, I tried this and much to my surprise, I was able to remove unused field names!  I think the key for me was the compact step.  In the article, they give you a command line way to run the ncompact task.  I think I was just assuming I could do that through the client (either Notes or Administrator) and it never worked.  When I used the command line version of the compact, it worked like a that....


So...  To save you the same pain, here's the entry...


Deleted Fields Still Showing in List of Fields When Writing Formula


Problem: 
In Notes R4 and later, fields that you have deleted from your database are still listed when you are writing a formula and click on the Fields & Functions button.


Content: 
Whenever a new field is added to a database, it is added to the Unique Field List.  The Unique Field List is used in the Fields & Formulas dialog box in R4 and the Reference tab's "Database Fields" list.  A new field can be added to a database by adding it to a design element, a document, or depositing a document into a database that contains new field names.  If the field is deleted or renamed in a document and/or design element, it will remain in the Unique Field List until the database is Compacted.  When the Compact process runs, it will scan all documents and design elements to recompile the Unique Field List.  If the field does not appear anywhere in the database, it will not appear in the Unique Field List after Compact has finished. 


If the database is flagged as full text indexed, the fields will NOT be removed from the list of fields by Compact.  Delete the full text index by using the Database Properties InfoBox (File, Database, Properties, click the Full Text tab, and click the Delete Index button), and then Compact the database. 


So, the proper steps to delete unwanted fields from the field list would be: 


1.        Delete the field(s) from all documents in the database. 
2.        Delete the field(s) from the design of all forms and subforms in the database. 
3.        Delete the database's full text index. 
4.        Compact the database.  




In one known customer case, after trying the solution presented above, it was discovered that a corrupt subform was the culprit.  Copying and pasting the subform did not resolve the issue; however the following actions allowed the unwanted field(s) to be removed: 


1.        Select all the design elements on the subform. 
2.        Copy the elements to a new subform. 
3.        Delete the original subform. 
4.        Compact the database.   


Note:  One method of ensuring that the unwanted field(s) are no longer in the database is to perform a design synopsis of the entire database (File, Database, Design Synopsis), and then search the synopsis for the field name(s).

Friday, June 11, 2010

IBM Lotus Symphony


IBM Lotus Symphony is a application suite for creating, editing, and sharing text, spreadsheet, presentations and other documents, and is currently distributed as freeware.

Lotus Symphony supports platforms for Microsoft Windows, Linux and Mac OS.

Symphony consists:

  • IBM Lotus Symphony Documents, (A Word Processor)
  • IBM Lotus Symphony Spreadsheets,(A Spreadsheet application)
  • IBM Lotus Symphony Presentations, (A Presentation application)
Symphony Icons




Document Application:

Lotus Symphony Documents supports .doc (Microsoft), .dot (Microsoft template), .docx (Microsoft Word 2007), .dotx (Microsoft Word 2007 template),.odt (ODF), .ott (ODF template), .sxw (OpenOffice.org 1.1 format), .stw (OpenOffice.org 1.1 format template), .lwp (IBM Lotus SmartSuite®), .mwp (IBM Lotus SmartSuite template), .rtf, and .txt formats


Spreadsheet Application:

Lotus Symphony Spreadsheets supports .xls (Microsoft), .xlt (Microsoft template), .xlsx (Microsoft Excel 2007), .xltx (Microsoft Excel 2007 template), .ods (ODF), .ots (ODF template), .sxc (OpenOffice.org 1.1 format), .stc (OpenOffice.org 1.1 format template), .123 (IBM Lotus Smartsuite), .12m (IBM Lotus Smartsuite template), .xml, and .csv formats


Presentation Application:

Lotus Symphony Presentations supports .ppt (Microsoft), .pot (Microsoft template), .pptx (Microsoft PowerPoint 2007), .potx (Microsoft PowerPoint 2007 template), .odp (ODF), .otp (ODF template), .prz (IBM Lotus Smartsuite), .mas (IBM Lotus Smartsuite look template), .smc (IBM Lotus Smartsuite content template), .sxi (OpenOffice.org 1.1 format), and .sti (OpenOffice.org 1.1 format template)formats.


Get more Information about symphony



Tuesday, March 10, 2009

Agent to Change Field Value in Lotus notes


To change the field value you have to always need to create some agent that will modify your database field. but in case if you are using multiple database and multiple changes then.... ????

So, now you can use this formula and create a toolbar button that will help you to change any of the field for any of the ... so enjoy..



choices := @DocFields;fullChoices := @Transform(choices; "x"; x + " = " +@Implode(@Text(@GetField(x)); ";"));fieldName := @Prompt([OkCancelEditCombo]; "Field Name"; "Select a fieldname from the dropdown listbox."; "";FullChoices);fieldName := @Left(fieldName; " = ");oldValue := @GetField(fieldname);newValue := @Explode(@Prompt([OkCancelEdit]; "New Field Value"; "Please enter the new field value." + @Char(13) +" Use ; for multivalues without mailto:space.@Implode(@Text(oldvalue);";")); ";");adjValue :=@If(@IsNumber(oldValue); @TextToNumber(newValue);@IsTime(oldValue); @TextToTime(newValue); newValue);@If(!@IsError(adjValue);@Do(@SetField(fieldName; adjValue); @Prompt([Ok]; "Field changed"; "Old field value: " + @Text(oldValue)+ @Char(13) + @Char(13) + "has been changed to" + @Char(13) + @Char(13) +"Nfield value: " + @Text(newValue)));@Prompt([YesNo]; "Change field value"; "New value not of same type as oldvalue. Set field to text?");@SetField(fieldName; newValue); "")