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


Aug 26, 2015, 7:59 AM
6 Posts

How to update DB's type

  • Category: Domino Designer
  • Platform: All Platforms
  • Release: 9.0
  • Role: Developer
  • Tags:
  • Replies: 6

I need to change the Database's type, for example: if the database's type is not Standard, I need to change to Standard, how to write the coding? Thanks for help!

Aug 26, 2015, 2:20 PM
48 Posts
How to update DB's type
Hello

The database type is determined by t= he template used to create the database

You can use the server's mail convert utility to convert non-mail databases to another type of non-mail database. Non-mail databases are all databases that do not have a $Inbox folder. Use the convert utility with the -d switch to prevent the conversion process from creating new folders for each category in the databases you are conver= ting.
When the load convert task is used w= ithout a switch, folders are created for all categories within the database. The load convert task looks for a $inbox, if there is no $Inbox, it processes the categories as views.
Enter the load convert -d task from the IBM=AE Lotus=AE Domino=AE server command line as follows:
load convert -d  databasename *  newtemplatename
Where databasename * is the name of the database you are converting  (includes all documents in that datab= ase).
Where newtemplatename is the name of the template that creates the type of database to which you are converting the non-mail database.
You can also convert an entire direc= tory as shown in this example,
load convert -d doclibrary\ *.nsf &n= bsp;newtemplatename
Where doclibrary\ *.nsf represents t= he name of the directory being converted and all databases in that directory.<= /font>
Where newtemplatename is the name of the template that creates the type of database to which you are converting all databases in the named directory.
Sep 3, 2015, 12:40 PM
12 Posts
$Flag of the DB icon containsthe database type
If you are wanting to actually change the design of the application then the above response is the way to go.  If you are not looking into changing the functionality but just that particular property on a Database then this TN talks about how to accomplish that


Lotus Software Knowledge Base Document

Title:        Is there a way to programmatically change Database Properties for a database?
Doc #:        1244071
URL:        
http://www.ibm.com/support/docview.wss?uid=swg21244071

From that TN we see that the following characters would indicate Database type in the $Flags

g = Type: Library.
j = Type: Personal Journal.
b = Type: Domino Directory.
B = Type: Directory Catalog.
m = Type: Multi DB Search.
u = Type: Portfolio.
A = Type: Mailbox.
r = Type: MailFile.


That TN also has an example on how to get a handle to the $Flags of the DB.  So we would just need to use that code to get the values in $Flags,  parse that string looking for lower case b as that is the flag for Domino Directory and replace it with the character for type of database we want to change it to.  We do not see Standard in that list of database types because there actually is no character for Standard.  If none of the above flags are in the $Flags then that means it is a standard Database.  So from your screen shot where we are wanting to change a Domino Directory to a Standard database then we just need to get the handle to the $Flags,  parse it looking for the 'b',  remove it and then re-save it.

I would suggest testing the DB after changing the type to make sure there are no unexpected side effects though.  
Sep 7, 2015, 9:01 AM
6 Posts
How to update DB's type with LotusScript

Hi,

Thanks for your help! But I want to know how to implement this function via LotusScript.

The example in the link seems to change the $Flags item value, not change the Database's type.

Sep 7, 2015, 4:14 PM
326 Posts
$flag

What Paul suggested is right on.  Changing the $flag values will change what the option look on the properties tab

Sep 8, 2015, 5:02 AM
6 Posts
I have done a test, but still not change

Hi Barry,

I have done a test yesterday, but the DB's type is still not change. Please refer the below coding.

Sub Click(Source As Button)
    Dim ws As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim doc As NotesDocument
    
    Set uidoc = ws.CurrentDocument
    Set doc = uidoc.Document
    
    doc.~$Flags = "Flag"
    doc.~$Flags = doc.~$Flags(0) & "B"
    Call doc.Save (True, False)
End Sub

The coding only add a $Flags field to the document, and give it's value "FlagB", not change the DB's type. Why?

Sep 8, 2015, 12:54 PM
326 Posts
Answer

doc.~$Flags = "Flag"
 doc.~$Flags = doc.~$Flags(0) & "B"
Call doc.Save (True, False)


SB
If Instr(doc.~$Flags(0)," ") = 0 then   '  This checks to see if already correct
  doc.~$Flags= Replace(doc.~$Flags(0) ,"g"," ")   ' This replaces g (library) with a blank
  Call doc.Save (True, False)
End if


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