Saturday, 13 September 2014

Sending email using LotusScript.

Sample code used for sending email using LotusScript.

code started from below :
Sub Initialize

 Dim session As new notessession
Dim db As notesdatabase
Dim docMail As notesdocument
Dim rtitem As Variant
Dim doc As notesdocument
Dim strSendTo As Variant
Dim strSubject As String
Dim strCopyTo As Variant

Set db=session.currentDatabase
Set docColl= db.Unprocessedocument
Set doc= docColl.getFirstDocumnet

While not doc is nothing
strSendTo= doc.getitemValue(sendTo)
 strCopyTo= doc.getitemValue(CopyTo)
Set docMail=db.createdocument
Set rtitem=docMail.CreateRichTextItem(“Body”)

If strSendTo(0) = "" Then Exit Sub

'=====set mail
docMail.Form = “Memo”
docMail.From = session.UserName
docMail.Principle = session.UserName
docMail.SendTo = strSendTo

If Isarray(strCopyTo) Then
If strCopyTo(0)<>"" Then
docMail.CopyTo = strCopyTo
End If
Else
If strCopyTo<>"" Then
docMail.CopyTo = strCopyTo
End If
End If

docMail.Recipients = strSendTo
docMail.Subject = strSubject
docMail.PostedDate = Now

'=====set body field
Call rtitem.AppendText("Please click this doclink to see more details about the status" + " ")
Call rtitem.AppendDocLink( doc, "click to open document")
Call rtitem.AddNewLine( 2 )

'=====send mail
Call docMail.send(False)
Set doc= docColl.getNextDocument(doc)
Wend

End Sub

Import data from freefile(.txt) to Notes

Sample code used for importing the data from .txt file to notes using LotusScript.

code started from below :

Sub Initialize
        On Error Goto Errhandler
Dim session As New NotesSession
Dim uiws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim fileName As Variant
Dim counter As Integer
Dim PaintName As String
Dim coatColor As String

Set db= session.CurrentDatabase
fileName= uiws.OpenFileDialog(False,"Test","*.txt","folderlocation")
FileNum% = Freefile()
If Not Isempty(fileName) Then
Open fileName(0) For Input As FileNum%
Do Until Eof(FileNum%)
Input #FileNum%, PaintName, CoatColor
Set doc= db.CreateDocument
With doc
.paintName=PaintName
.CoatColor=CoatColor
End With
Call doc.save(False,False)
counter=counter+1
Loop
End If
Exit Sub
Errhandler:
Msgbox "Error on line number : " & Erl &" Error description : " & Error()
End Sub

Import from Excel to Notes

Sample code used for  importing the data from excel file to notes using LotusScript.

code started from below :

Sub Initialize
Dim session As New notessession
Dim db As NotesDatabase
Dim form As NotesForm
Set db=session.CurrentDatabase
Set form = db.GetForm("FormName")

Dim xlapp As Variant
Dim xlworksheet As Variant
Dim xlsheet As Variant
Set xlapp = CreateObject("Excel.Application")
xlapp.Visible = False
Set xlworksheet = xlapp.Worksheet.Open("pathforfile")
Set xlsheet = xlworksheet.WorkSheet(1)

Dim rows, cols As Integer

xlsheet.Cells.SpecialCells(10).Active
rows= xlsheet.ActiveWindow.ActiveCell.row
Cols = xlsheet.ActiveWindow.ActiveCell.Column

Dim row As Integer
row =0

Do While True
row =row+1
If row = rows+1 Then
Goto Done
End If
If row =1 Then
For i=1 To cols
Redim Preserve fd(i) As String
fd(i) = xlsheet.cells(row,i).value
flag=0
Forall n In form.Fields
If Lcase(fd(i)) = Lcase(n) Then
flag=1
End If
End Forall
If flag=1 Then
Goto skip
End If
If Not flag=1 Then
Msgbox "Field name not appear in the form"
Goto Errhandler
End If

Skip :
Next
End If
If Not row=1 Then
Set doc = db.CreateDocument
doc.Form = formname
For i=1 To cols
Set item= doc.replaceitemvalue(fd(i), xlsheets.Cells(row,i).Value)
Next
End If
Done:
Call xlworksheet.Close
Call xlapp.Quit
Set xlapp=Nothing
Loop
Exit Sub
Errhandler:
Msgbox "Error on Line number : " &Erl() & "Error desc : " &Error()
End Sub

Tuesday, 17 June 2014

Why move to Xpages?

Need to migrate Lotus Notes application on Web, Cloud or Mobile then Xpages will help you in migration of your Lotus Notes Application.Que. What is XPages?Ans. XPages is a rapid web and mobile application platform developed by IBM to modernize your Lotus Notes Applications. It allows IBM Lotus Notes data as well as data from relational and other data sources to be displayed to browser clients on all platforms. Programming model of Xpages is based on standards and common web development skills like JavaScript, Ajax, the Dojo Toolkit, Server-side JavaScript, and JavaServer Faces. Que. Why XPages?Ans.  XPages is needed because of following points which are listed below :    1. XPages is the quickest way to take your Lotus Notes applications to web and mobile.    2. Reduces the dependency on Lotus Notes Client also enable users to access the applications from anywhere and anytime    3. Modules of code can be reusable.    4. Provide you rich UI without disturbing existing functionality of  Application.    5. Easy integration with all applications.    6. Smooth and Glossy UI theme.    7. Offline access of databases.    8. In Migration of application to XPages there is zero percent data loss.    9. XPages let you to create Web 2.0 enabled pages based on JSF technology.

    


Monday, 16 June 2014

Implementation/up-gradation of World Wide Web from Web 1.0 - 3.0

World Wide Web opens the new way to see the world through internet. It makes our day to day life easier in all around. We can easily operate our business globally.
The first implementation of the web represents the Web 1.0, which, according to Berners-Lee, could be considered the “read-only web.”
Web 1.0 : 
In the beginning of web the information published in a static form well designed with the text and images. The main features of web 1.0 are hyper-linking and bookmarking of the web pages. 
Features of web 1.0 technology
1. HTML based Static page. 
2. It consists of frame-sets.
3. Online guestbook.
4. HTML form sent through email.
5. There was nothing to exchange. Everything was about one way.

The second implementation of the web represents the Web 2.0, in year 2002 term Web 2.0 was first introduced by O'Reilly during the brainstorming discussion MediaLive International. The information available in this form is quite different from the past web1.0. It began with new ideas to exchange as well as share the content such as Wiki, Weblogs, Widgets, and Tagging etc. 
Features of web 2.0 technology
1. Clean and simple design
2. Number of columns is few.
3. Simple navigation which is fixed in every pages of the site.
4. Central layout.
5. You can exchange your ideas by commenting/writing there.
6. Not only interact with site or webmaster but also communicate with others who will access that website.
7.  Web 2.0 is the field of XML.

The enhanced one implementation of the web 2.0 represents the Web 3.0
Web 3.0 :
It would be something related to a “read-write-execute” web. However, this is difficult to envision in its abstract form, so let us take a look at two things I predict will form the basis of the Web 3.0 — semantic markup and web services personalization like iGoogle, My Yahoo etc. it is a web service software system designed to support computer-to-computer interaction over the internet.