This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 16, 2015, 2:17 AM
8 Posts

Lotus form's Postopen coding change to Xpage

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1
 

I have an application, there are some coding in the Lotus form's Postopen, now I need to change this client application to web with XPage.

How could I write coding in XPage to realize the form's Postopen function? Thanks for help!

Following is the form's Postopen coding:

Sub Postopen(Source As Notesuidocument)
.........
Set Targetdb = New NotesDatabase(db.Server, "OAS\PERSONAL.NSF")
Set enameview = Targetdb .GetView( "ENAMEVIEW" )
If enameview Is Nothing Then
    Print "Coludn't find ENAMEVIEW  View."
    Exit Sub
End If
Set cnameview = Targetdb .GetView( "CNAMEVIEW" )
If cnameview Is Nothing Then
    Print "Couldn't find CNAMEVIEW  View."
    Exit Sub
End If
Set Personaldoc = enameview.GetDocumentByKey(userName.ABBREVIATED,True)
If Personaldoc Is Nothing  Then
    message = "Couldn't find your information in Personal Database。 " &  Chr(10)
    msgtype = MB_OK + MB_ICONSTOP
    return_code = Messagebox (message, msgtype, db.Title)
    Exit Sub
End If
Set doc = Source.Document
If doc.IsNewNote Then
            doc.dept=Personaldoc.DEP_NO_CNAME(0)
    doc.Jiao = Personaldoc.C_NAME(0)
    doc.Location = Personaldoc.Location(0)
    If Personaldoc.C_SUPERIOR2(0)="" Then
        doc.Director= Personaldoc.C_SUPERIOR(0)
    Else
        doc.Director= Personaldoc.C_SUPERIOR2(0)
    End If
End If

End Sub

Apr 20, 2015, 2:29 AM
453 Posts
You would use the Before or AfterPageLoad event

This event can be on a Custom Control or an XPage depending on your requirements. You need to research this a bit because some items are not available in the BeforePageLoad event that are there in the AfterPageLoad, so it really depends on what you need to do. And of course you will write it in JavaScript, but the syntax is almost the same as LS.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal