Domino Code Fragment

Code Name*
Force form check on creation of response doc.
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.118.0.240
Description*
This checks the current form you are on and ensures that it is viable for the response form to be created
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
This code goes in the PostOpen event of the response form.
It checks the selected document and ensures that it was created using the company form
before creating the response.

Sub Postopen(Source As Notesuidocument)
    Dim otherform As String
    ' Grab form information from otherform field to ensure we have the correct parent
    otherform = source.FieldGettext("OtherForm")
    ' Lets ensure we are in a new document
    If Source.IsNewDoc Then
         ' If parent form is incorrect then we display message and close this form
         If otherform <> "Company" Then
              Messagebox "Please Hi-Light Company Profile!", 16, "Selection Error"
              Call source.close
         End If
    End If
End Sub