Skip to main content
 
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 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

How to recover all masks and fields of a database with LotusScript
Clode Berube 21.Jul.03 08:41 AM a Web browser
Domino Designer -- LotusScript 5.0.11; 4.6.6c Windows XP

Hi, I’m trying to get the information from the database concerning the fields included in the forms and

subforms. For all the forms, I also want to find the types of these forms.



2 solutions occurred:



First, Gets all the fields but it is impossible to get the type of field.

----code----
Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim docs As NotesDocument
Dim dTemp As NotesDocument
Dim db As NotesDatabase
Dim t As Integer

Dim Serveur As Variant
Dim NomBase As Variant
Dim x As Integer
Dim y As Integer
Dim i As Integer

Set db = Session.CurrentDatabase
'permits to be going to look for the server's name
Serveur = db.server

Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
'name of the chosen base by the user
NomBase = doc.Nom_Base

'going to point on the base selected by the user
Dim dbAutre As New NotesDatabase(Serveur , NomBase(0))

'going to pass through all masks of the chosen base by the user
Forall Snogs In dbAutre.Forms

'addition of the name of fields of the mask
Call uidoc.FieldAppendText("NomMasque" , Cstr(Snogs.Name) + Chr(10))

x = 0
y = 3

'buckle that permits to be going to look for names of fields and their type of fields
On Error Goto ErreurSnogs
t = Ubound(Snogs.Fields)
On Error Goto 0

If t > 0 Then

Forall zeItem In Snogs.Fields

'going to create a document answer containing all fields of a mask
Set docs = db.CreateDocument

'going to fill fields with the gotten data
docs.Form = "InfosChamps"
docs.Nom_Base = doc.Nom_Base
docs.NomMasque = Snogs.Name
docs.ChampsMasque = Snogs.Fields(x)

'going to write down the type of fields in the variable nomchamps
Select Case docs.Items(y).Type
Case ATTACHMENT : nomchamps = "Fichier d'attachement"
Case EMBEDDEDOBJECT : nomchamps = "Objet"
Case ERRORITEM : nomchamps = "Erreur survenue quand on accède au type"
Case NAMES : nomchamps = "Noms"
Case AUTHORS : nomchamps = "Auteurs"
Case READERS : nomchamps = "Lecteurs"
Case NOTELINKS : nomchamps = "Référence à un document parent"
Case NOTEREFS : nomchamps = "Lien Doc"
Case NUMBERS : nomchamps = "Nombre ou Liste de nombre"
Case RICHTEXT : nomchamps = "Texte riche"
Case SIGNATURE : nomchamps = "Signature"
Case DATETIMES: nomchamps = "Date ou Ensemble de valeurs"
Case TEXT : nomchamps = "Texte"
Case UNAVAILABLE : nomchamps = "Non disponible"
Case UNKNOWN : nomchamps = "Inconnu"
Case USERDATA : nomchamps = "Données de l'utilisateur"
Case USERID : nomchamps = "Fichier ID de l'utilisateur"
Case Else : nomchamps = docs.Items(y).Type
End Select

'enrollment of the field type
docs.TypeChamps = nomchamps


x = x+1

'save the document containing all fields
Call docs.Save( True, False )

End Forall

End If


Call uidoc.FieldAppendtext("NomMasque" , " " + Chr(10))

End Forall

'save the document
Call doc.Save( True, True )

Exit Sub

ErreurSnogs:
t = 0
Resume Next

End Sub






Second, Cannot get all the fields but is able to get all the types of fields.

---code----
Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim docs As NotesDocument
Dim dTemp As NotesDocument
Dim db As NotesDatabase

Dim Serveur As Variant
Dim NomBase As Variant

Set db = Session.CurrentDatabase
'permits to be going to look for the server's name
Serveur = db.server

Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
'name of the chosen base by the user
NomBase = doc.Nom_Base

'going to point on the base selected by the user
Dim dbAutre As New NotesDatabase(Serveur , NomBase(0))

'going to pass through all masks of the chosen base by the user
Forall Snogs In dbAutre.Forms

Set dTemp = dbAutre.CreateDocument
dTemp.Form = Snogs.Name
Call dTemp.ComputeWithForm(True, False)

'addition of the name of fields of the mask
Call uidoc.FieldAppendText("NomMasque" , "FORM : " & Cstr(Snogs.Name) + Chr(10))

Forall zeItem In dTemp.Items

'going to create a document answer containing all fields of a mask
Set docs = db.CreateDocument
docs.Form = "InfosChamps"
docs.Nom_Base = doc.Nom_Base
docs.NomMasque = Snogs.Name
docs.ChampsMasque = zeItem.Name + Chr(10)


'enrollment of the field name in the NomMasque fields
'Call uidoc.FieldAppendText("NomMasque" , "Champs : " & Ucase(zeItem.Name) & " : ")

'write down a message according to the type of fields
Select Case zeItem.Type
Case ATTACHMENT : nomchamps = "Fichier d'attachement"
Case EMBEDDEDOBJECT : nomchamps = "Objet Embedded "
Case ERRORITEM : nomchamps = "Erreur occurred while accessing type"
Case NAMES : nomchamps = "Noms"
Case AUTHORS : nomchamps = "Auteurs"
Case READERS : nomchamps = "Lecteurs"
Case NOTELINKS : nomchamps = "Référence à un document parent"
Case NOTEREFS : nomchamps = "Lien Doc"
Case NUMBERS : nomchamps = "Nombre ou Liste de nombre"
Case RICHTEXT : nomchamps = "Texte riche"
Case SIGNATURE : nomchamps = "Signature"
Case DATETIMES: nomchamps = "Date ou Ensemble de valeurs"
Case TEXT : nomchamps = "Texte ou liste de texte"
Case UNAVAILABLE : nomchamps = "Non disponible"
Case UNKNOWN : nomchamps = "Inconnu"
Case USERDATA : nomchamps = "Données de l'utilisateur"
Case USERID : nomchamps = "Fichier ID de l'utilisateur"
Case Else : nomchamps = zeItem.Type
End Select

'enrollment of the field type
docs.TypeChamps = nomchamps + Chr(10)
' Call uidoc.FieldAppendtext("NomMasque" , espace & Ucase(nomchamps) & Chr(10))


Call docs.Save( True, False )
End Forall

Call uidoc.FieldAppendtext("NomMasque" , Chr(10))

End Forall

'save document
Call doc.Save( True, True )
End Sub



Can you help me ?

Thanks a lot.




How to recover all masks and fields... (Clode Berube 21.Jul.03)
. . RE: How to recover all masks and fi... (Haydn Parker 21.Jul.03)
. . . . RE: How to recover all masks and fi... (Clode Berube 21.Jul.03)
. . . . . . RE: How to recover all masks and fi... (Haydn Parker 21.Jul.03)
. . . . . . . . RE: How to recover all masks and fi... (Clode Berube 21.Jul.03)
. . . . . . . . . . RE: How to recover all masks and fi... (Haydn Parker 21.Jul.03)






  Document options
Print this pagePrint this page

 Search this forum

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

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

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

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
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
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow