Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext

RE: How about posting the error?
amar ku das 20.Mar.16 11:23 AM a Web browser
Notes Client 7.0.3 Windows XP


My Code is below

Problem come after xml creation and put in richtext field and then try to edit this uidocument where i put xml string when i just comment XML code it is working fine.

Sub Initialize

'On Error Goto errH

Set S = New NotesSession
Set W = New NotesUIWorkspace
Set ITIView = S.CurrentDatabase.GetView("(LookupTourITI)")

LocalITI = S.GetEnvironmentString("localITI")
If LocalITI = "YES" Then
Call s.SetEnvironmentVar("localITI","")
If Not SetTourDoc Then
Exit Sub
End If
Else
If Not SetReconformTourDoc Then
Exit Sub
End If
End If
' If Not SetTourDoc Then
' Exit Sub
' End If

Set MstrDb = S.GetDatabase(S.CurrentDatabase.Server, tDoc.MastrDB(0))
Set MstrView = MstrDb.GetView("(Code)")
'AKD 110316
Set StfDb = S.GetDatabase(S.CurrentDatabase.Server, "Dolphin\Live\tumstfdb.nsf")
Set Stfvw = StfDb.GetView ("(StaffMembers)")
'AKD 110316
If tDoc.LinkNumber(0) = "" Then
Msgbox "There is no document found (having desired status and details) to generate Final Itinerary.", 64, ".: No Doucmnets Found :."
Exit Sub
End If
Set Coll = ITIView.GetAllDocumentsByKey(tDoc.LinkNumber(0), True)
If Coll.Count <=0 Then
Msgbox "There is no document found (having desired status and details) to generate Final Itinerary.", 64, ".: No Doucmnets Found :."
Exit Sub
End If
'If S.GetEnvironmentString("PreServiceITI") <> "Final" Then
' ans% = Msgbox("Do you want Booking Status in this Itinerary?", 36, ".: PRELIMINARY ITINERARY :.")
'End If
'// ----- Display Setings ----- //
Call ITIDisplaySettings
If nDoc Is Nothing Then
Exit Sub
End If
'// ----------------------------- //
Redim DocArr(0)
Redim DayArr(0)
Redim DateArr(0)

If LocalITI = "YES" Then
Call CreateITIDoc
End If

'// Also add required status //
ReqStatus(0) = "Change Fax Sent"
ReqStatus(1) = "Change Email Sent"
ReqStatus(2) = "(Changed) Change Fax Sent"
ReqStatus(3) = "(Changed) Change Email Sent"
ReqStatus(4) = "Confirmed"
ReqStatus(5) = "(Changed) Confirmed"
ReqStatus(6) = "Not Booked by Tumlare"
ReqStatus(7) = "Confirmed V"
ReqStatus(8) = "(Changed) Confirmed V"
ReqStatus(9) = "Confirmed A"
ReqStatus(10) = "(Changed) Confirmed A"
ReqStatus(11) = "Wait Listed"
ReqStatus(12) = "(Changed) Wait Listed"

Set Doc = Coll.GetFirstDocument
Redim OptLink(optLinkCnt)
Redim OptTimeArr(OptSortCnt)
Redim DocArr(OptSortCnt)
Redim OptBkgText(OptBkgTextCnt)
While Not Doc Is Nothing
dCntr = 1

If Doc.Form(0) = "Tour" Or Doc.Form(0) = "Segment" Then
Goto nxtBkg
End If

Set tItem = Doc.GetFirstItem("BookinginITI")
If Not tItem Is Nothing Then
If tItem.Text = "No" Then
Goto nxtBkg
End If
End If
' Msgbox Doc.Status(0)
' Msgbox Doc.SuppFullName(0)

If S.GetEnvironmentString("PreServiceITI") = "Final" And Doc.PKGType(0) <> "OPT" And ndoc.Status(0)="No" Then
If Datatype(Arraygetindex(ReqStatus, Doc.Status(0))) = 1 Then
Goto nxtBkg
End If
End If


If Doc.CalendarDates(0) = "" Then
Call SetDatesForCalendarDates
Call PopulateCalendarDate
End If
Sort = True

Dim textITIOptLinkflag As Boolean ' Code to remove Text ITI Duplicacy in case it has optLinkNumber
textITIOptLinkflag = False
If Doc.Form(0) = "Text ITI" Then
If Doc.OptLinkNumber(0) <> "" Then
textITIOptLinkflag = False
Else
textITIOptLinkflag = True
End If
Else
textITIOptLinkflag = True
End If

If Doc.PkgType(0) <> "OPT" And textITIOptLinkflag Then
' If Doc.PkgType(0) <> "OPT" Then
Set cItm = Doc.GetFirstItem("CalendarDates")
Forall x In cItm.Values
Redim Preserve DocArr(Cntr)
Redim Preserve DayArr(Cntr)
Redim Preserve DateArr(Cntr)
D% = Cint(Right(x, 2))
M% = Cint(Mid(x, 6, 2))
Y% = Cint(Left(x, 4))
Set tDate = New NotesDateTime(Datenumber(Y%, M%, D%))
Set DocArr(Cntr) = Doc
DayArr(Cntr).Form = Doc.Form(0)
DayArr(Cntr).fDat = populateBkgDate
DayArr(Cntr).fTime = populateBkgTime(Doc)
DayArr(Cntr).cDat = Format(tDate.DateOnly, "dd-mm-yyyy")
DayArr(Cntr).Day = Cstr(dCntr)
DayArr(Cntr).lastDay = False
DateArr(Cntr) = Format(tDate.DateOnly, "dd-mm-yyyy")
Cntr = Cntr + 1
dCntr = dCntr + 1
End Forall
Else
Set OptColl = Coll
If OptColl.Count > 0 Then
Set sDoc = OptColl.GetFirstDocument
While Not sDoc Is Nothing
'##### Exclude opt bookings with BookinginITI = "No" frm ITI ####
Dim optItm As NotesItem
Set optItm = sDoc.GetFirstItem("BookinginITI")
If Not optItm Is Nothing Then
If optItm.Text <> "No" Then

If sDoc.Status(0) <> "Deleted" And sDoc.Status(0) <> "Not Available" And sDoc.Status(0) <> "Fully Booked"_
And sDoc.Status(0) <> "Cancelled" And sDoc.Status(0) <> "Cancellation Fax Sent" And sDoc.Status(0) <> "Cancellation Email Sent" And sDoc.Status(0) <> "To be Cancelled" Then
If SetOptDoc(sDoc) Then
Dim pos As Variant
pos = Arraygetindex(OptLink, sDoc.OPTLinkNumber(0) & ":" & sDoc.UniversalID)
If Datatype(pos) = 1 Then
Redim Preserve OptDocArr(OptSortCnt)
Redim Preserve OptTimeArr(OptSortCnt)
Redim Preserve OptLink(OptSortCnt)
Set OptDocArr(OptSortCnt) = sDoc
OptTimeArr(OptSortCnt) = populateBkgTime(sDoc)
OptLink(OptSortCnt) = sDoc.OptLinkNumber(0) & ":" & sDoc.UniversalID
OptSortCnt = OptSortCnt +1
OptText = True
End If
End If
End If
End If
Else
If sDoc.Status(0) <> "Deleted" And sDoc.Status(0) <> "Not Available" And sDoc.Status(0) <> "Fully Booked"_
And sDoc.Status(0) <> "Cancelled" And sDoc.Status(0) <> "Cancellation Fax Sent" And sDoc.Status(0) <> "Cancellation Email Sent" And sDoc.Status(0) <> "To be Cancelled" Then
If SetOptDoc(sDoc) Then
Dim opos As Variant
opos = Arraygetindex(OptLink, sDoc.OPTLinkNumber(0) & ":" & sDoc.UniversalID)
If Datatype(opos) = 1 Then
Redim Preserve OptDocArr(OptSortCnt)
Redim Preserve OptTimeArr(OptSortCnt)
Redim Preserve OptLink(OptSortCnt)
Set OptDocArr(OptSortCnt) = sDoc
OptTimeArr(OptSortCnt) = populateBkgTime(sDoc)
OptLink(OptSortCnt) = sDoc.OptLinkNumber(0) & ":" & sDoc.UniversalID
OptSortCnt = OptSortCnt +1
OptText = True
End If
End If
End If
End If '##### Exclude opt bookings with BookinginITI = "No" frm ITI ####
nxtBukg:
Set sDoc = OptColl.GetNextDocument(sDoc)
Wend
End If

'////////////// Sorting of OptDocArr and OptTimeArr /////////////////
If OptText Then
OptText = False
For i = 0 To Ubound(OptDocArr) - 1
For j = i + 1 To Ubound(OptDocArr)
If Cdat(OptTimeArr(i)) > Cdat(OptTimeArr(j)) Then
Set tmpODoc = OptDocArr(i)
Set OptDocArr(i) = OptDocArr(j)
Set OptDocArr(j) = tmpODoc
tmpStr$ = OptLink(i)
OptLink(i) = OptLink(j)
OptLink(j) = tmpStr$
temptime$ = OptTimeArr(i)
OptTimeArr(i) = OptTimeArr(j)
OptTimeArr(j) = temptime$
End If
Next
Next

' For i = 0 To Ubound(OptDocArr) - 1
' For j = i + 1 To Ubound(OptDocArr)
' OptLink1$ = Left(Optlink(i),Instr(OptLink(i),":")-1)
' OptLink2$ = Left(Optlink(j),Instr(OptLink(j),":")-1)
' If OptLink1$ > OptLink2$ Then
' Set tmpODoc = OptDocArr(i)
' Set OptDocArr(i) = OptDocArr(j)
' Set OptDocArr(j) = tmpODoc
' tmpStr$ = OptLink(i)
' OptLink(i) = OptLink(j)
' OptLink(j) = tmpStr$
' End If
' Next
' Next
'/////////////// End Sorting of OptDocArr and OptTimeArr /////////////////

For k = 0 To Ubound(OptDocArr)
Dim TmpOptdoc As NotesDocument
Set TmpOptdoc = OptDocArr(k)
Set cItm = TmpOptDoc.GetFirstItem("CalendarDates")
Forall x In cItm.Values
Redim Preserve DocArr(Cntr)
Redim Preserve DayArr(Cntr)
Redim Preserve DateArr(Cntr)
D% = Cint(Right(x, 2))
M% = Cint(Mid(x, 6, 2))
Y% = Cint(Left(x, 4))
Set tDate = New NotesDateTime(Datenumber(Y%, M%, D%))
Set DocArr(Cntr) = OptDocArr(k)
DayArr(Cntr).Form = OptDocArr(k).Form(0)
DayArr(Cntr).fDat = populateBkgDate
If k = 0 Then
Bkgtime$ = OptTimeArr(k)
End If
' DayArr(Cntr).fTime = Bkgtime$
DayArr(Cntr).fTime = OptTimeArr(k)
DayArr(Cntr).cDat = Format(tDate.DateOnly, "dd-mm-yyyy")
DayArr(Cntr).Day = Cstr(dCntr)
DayArr(Cntr).lastDay = False
DateArr(Cntr) = Format(tDate.DateOnly, "dd-mm-yyyy")
Cntr = Cntr + 1
dCntr = 1
End Forall

Redim Preserve OptBkgText(OptBkgTextCnt)
OptBkgText(OptBkgTextCnt) = TmpOptdoc.PKGAbbrev(0)
OptBkgTextCnt = OptBkgTextCnt + 1
Next
End If
End If

Sort = False
If Doc.Form(0) = "Hotel" Then '// All this only for Hotel for Last day Breakfast //
Call tDate.AdjustDay(1)
Redim Preserve DocArr(Cntr)
Redim Preserve DayArr(Cntr)
Redim Preserve DateArr(Cntr)
Set DocArr(Cntr) = Doc
DayArr(Cntr).Form = Doc.Form(0)
DayArr(Cntr).fDat = populateBkgDate
DayArr(Cntr).cDat = Format(tDate.DateOnly, "dd-mm-yyyy")
DayArr(Cntr).Day = Cstr(dCntr)
DayArr(Cntr).lastDay = True
dCntr = 1
DayArr(Cntr).fTime = populateBkgTime(Doc)
DateArr(Cntr) = Format(tDate.DateOnly, "dd-mm-yyyy")
Cntr = Cntr + 1
End If

If Doc.Form(0) = "Ferry" And Doc.Rooming(0) = "Overnight" Then '// All this only for Ferry for Last day Breakfast //
Call tDate.AdjustDay(1)
Redim Preserve DocArr(Cntr)
Redim Preserve DayArr(Cntr)
Redim Preserve DateArr(Cntr)
Set DocArr(Cntr) = Doc
DayArr(Cntr).Form = Doc.Form(0) & "O"
DayArr(Cntr).fDat = populateBkgDate
DayArr(Cntr).cDat = Format(tDate.DateOnly, "dd-mm-yyyy")
DayArr(Cntr).Day = Cstr(dCntr)
DayArr(Cntr).lastDay = True
dCntr = 1
DayArr(Cntr).fTime = populateBkgTime(Doc)
DateArr(Cntr) = Format(tDate.DateOnly, "dd-mm-yyyy")
Cntr = Cntr + 1
End If

If Doc.Form(0) = "Train" And Doc.Rooming(0) = "Overnight" Then '// All this only for Train for Last day Breakfast //
Call tDate.AdjustDay(1)
Redim Preserve DocArr(Cntr)
Redim Preserve DayArr(Cntr)
Redim Preserve DateArr(Cntr)
Set DocArr(Cntr) = Doc
DayArr(Cntr).Form = Doc.Form(0) & "O"
DayArr(Cntr).fDat = populateBkgDate
DayArr(Cntr).cDat = Format(tDate.DateOnly, "dd-mm-yyyy")
DayArr(Cntr).Day = Cstr(dCntr)
DayArr(Cntr).lastDay = True
dCntr = 1
DayArr(Cntr).fTime = populateBkgTime(Doc)
DateArr(Cntr) = Format(tDate.DateOnly, "dd-mm-yyyy")
Cntr = Cntr + 1
End If

nxtBkg:
Set Doc = Coll.GetNextDocument(Doc)
Wend

Call SortDateArr
tDateArr = Arrayunique(DateArr)
Redim BkgDetailsArr(bCntr)
fCntr = 0
Forall Dt In tDateArr
Cntr = 0
dCntr = 0
DateStr = Dt
Forall Dy In DayArr
If Dt = Dy.cDat Then
Redim Preserve tDayArr(Cntr)
Redim Preserve tDocArr(Cntr)
tDayArr(Cntr) = Dy
Set tDocArr(Cntr) = DocArr(dCntr)
Cntr = Cntr + 1
End If
dCntr = dCntr + 1
End Forall

Call populateBkgDetails

End Forall

If Ubound(BkgDetailsArr) < 0Then
Msgbox "There is no document found (having desired status and details) to generate Final Itinerary", 64, ".: No Doucmnets Found :."
Exit Sub
End If

'// Iitializing HTML File to print data
FileNum = Freefile()
' add by akd on 08/12/08
Dim var As String
var= tDoc.ReferenceNo(0)
If Instr(Left(tDoc.ReferenceNo(0),15),"/")>0 Then
Call replacesubstring(var, "/", "-")
End If
FileName = "C:\TAS\ITI-" + Left(var, 15) + ".html"
' end by akd on 08/12/08

'Open FileName For Output As FileNum
Open FileName For Output As FileNum Charset = "UTF-8" ' AKD 190815
'// Generating HTML file
Print #FileNum, "<HTML><BODY>"
Print #FileNum, "<Meta http-equiv='content-type'content='text/html;charset=UTF-8'>" ' AKD 190815
Print #FileNum, "<TABLE WIDTH = 650 HEIGHT = 1500 BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>"
Print #FileNum, "<TR>"
Print #FileNum, "<TD width = 70 height = 0 VAlign = Top Align = Right NOWRAP><Font Face = 'Arial' Size = '1'><B>Day / Date</B></Font></TD>"
Print #FileNum, "<TD width = 50 height = 0 VAlign = Top Align = Right NOWRAP><Font Face = 'Arial' Size = '1'><B>&nbsp;</B></Font></TD>"
Print #FileNum, "<TD width = 420 height = 0 VAlign = Top Align = Left><Font Face = 'Arial' Size = '1'><B>Itinerary Details</B></Font></TD>"
If nDoc.Pax(0) = "Yes" Then
Print #FileNum, "<TD width = 30 height = 0 VAlign = Top Align = Left NOWRAP><Font Face = 'Arial' Size = '1'><B>Pax</B></Font></TD>"
Else
Print #FileNum, "<TD width = 30 height = 0 VAlign = Top Align = Left NOWRAP><Font Face = 'Arial' Size = '1'><B>&nbsp;</B></Font></TD>"
End If
Print #FileNum, "<TD width = 80 height = 0 VAlign = Top Align = Left NOWRAP><Font Face = 'Arial' Size = '1'><B>HOffice</B></Font></TD>"
Print #FileNum, "</TR>"
dCntr = 1
For j = 0 To Ubound(BkgDetailsArr)
If BkgDetailsArr(j) <> "" Then
' If Instr(FinalDateArr(j), "*<BR>") > 0 Then
' dStr$ = Right(FinalDateArr(j), (Len(FinalDateArr(j)) - Instr(FinalDateArr(j), ">")))
' Set tDate = New NotesDateTime(dStr$)
' dStr$ = "Day " & Format(dCntr, "00") + "<BR>" + Format(tDate.DateOnly, "dd mmm") & " " & WeekDayText(Cstr(Weekday(tDate.DateOnly)))
' dCntr = dCntr + 1
' NewLine$ = "<BR>"
If Instr(FinalDateArr(j), "*") > 0 Then
dStr$ = "<B>" + Mid(FinalDateArr(j), Instr(FinalDateArr(j), "*") + 1, Len(FinalDateArr(j)) - 1) + "</B>"
NewLine$ = ""
Elseif Instr(FinalDateArr(j), "<BR>") > 0 Then
dStr$ = Left(FinalDateArr(j), Instr(FinalDateArr(j), "<BR>") - 1)
Set tDate = New NotesDateTime(dStr$)
City$ = Right(FinalDateArr(j), Len(FinalDateArr(j)) - (Instr(FinalDateArr(j), "<BR>") + 3))
dStr$ = "Day " & Format(dCntr, "00") + "<BR>" + Format(tDate.DateOnly, "dd mmm") & " " & WeekDayText(Cstr(Weekday(tDate.DateOnly))) & "<BR><B>" + City$ + "</B>"
dCntr = dCntr + 1
NewLine$ = "<BR>"
Else
Set tDate = New NotesDateTime(FinalDateArr(j))
dStr$ = "Day " & Format(dCntr, "00") + "<BR>" + Format(tDate.DateOnly, "dd mmm") & " " & WeekDayText(Cstr(Weekday(tDate.DateOnly)))
dCntr = dCntr + 1
NewLine$ = "<BR>"
End If
infoS$ = ReplaceSubString(BkgDetailsArr(j), "<BR><BR>", "<BR>")
If Not(dStr$ = "<B>&nbsp;</B>" And TimeArr(j) = "" And InfoS$ = "") Then '// All this only for Hotel for Last day Breakfast //
Print #FileNum, "<TR>"
Print #FileNum, "<TD width = 70 height = 0 VAlign = Top Align = Right><Font Face = 'Arial' Size = '1'>"+ NewLine$ + "<B>" + dStr$ +"</B><BR></Font></TD>"
Print #FileNum, "<TD width = 50 height = 0 VAlign = Top Align = Right><Font Face = 'Arial' Size = '1'>"+ NewLine$ + TimeArr(j) +"</Font></TD>"
Print #FileNum, "<TD width = 420 height = 0 VAlign = Top><Font Face = 'Arial' Size = '1'>"+ NewLine$ + infoS$ +"</Font></TD>"
If nDoc.Pax(0) = "Yes" Then
Print #FileNum, "<TD width = 30 height = 0 VAlign = Top Align = Left><Font Face = 'Arial' Size = '1'>"+ NewLine$ + +Pax(j)+"</Font></TD>"
Else
Print #FileNum, "<TD width = 30 height = 0 VAlign = Top Align = Left><Font Face = 'Arial' Size = '1'>&nbsp;</Font></TD>"
End If
Print #FileNum, "<TD width = 80 height = 0 VAlign = Top Align = Left><Font Face = 'Arial' Size = '1'><B>"+ NewLine$ + +HO(j)+"</B></Font></TD>"
Print #FileNum, "</TR>"
End If
End If
Next

Print #FileNum, "</TABLE>"
Print #FileNum, "<Center><Font Face = 'Arial' Size = '2'>- END OF SERVICE -</Font></Center></BODY></HTML>"
Close FileNum

If LocalITI = "YES" Then
'// Making response to history doc
If tDoc.TourType(0) <> "MST" Then
Set tColl = tDoc.Responses
Set hDoc = tColl.GetFirstDocument
While Not hDoc Is Nothing
If hDoc.Form(0) = "History" Then
Call ITIDoc.MakeResponse(hDoc)
End If
Set hDoc = tColl.GetNextDocument(hDoc)
Wend
Else
Call ITIDoc.MakeResponse(tDoc)
End If
Call CreateXML(tDoc,ITIDoc) 'AKD 090316
Set uDoc = W.EditDocument(True, ITIDoc)
'Call W.EditDocument(False,ITIDoc)
Call uDoc.GotoField("TextBuffer")
Call uDoc.Import("HTML", FileName)

If S.GetEnvironmentString("PreServiceITI") = "Final" Then
Call uDoc.FieldSetText("SaveOptions","1")
Call uDoc.Save
End If
Else
Call response.GotoField("TextBuffer")
Call response.SelectAll
Call response.Import("HTML", FileName)
Call response.Refresh
End If
'Call W.URLOpen(FileName)
'Kill FileName

Exit Sub
errH:
Msgbox "Error in Initialize @ " & Cstr(Erl) & " and error is: " & Error , 64, ".: ERROR :."
Exit Sub
End Sub




user defined error (amar ku das 18.Mar.16)
. . How about posting the error? (Carl Tyler 18.Mar.16)
. . . . RE: How about posting the error? (amar ku das 20.Mar.16)
. . . . . . RE: How about posting the error? (Chris Chisholm 4.Apr.16)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite