Solved

Creating views (lots) in DB without using Designer

Posted on 2004-07-30
15
234 Views
Last Modified: 2013-12-18
Hi,
I have a template DB. Very often, I have to create databases with this template and add views. There is 4 types of view and I have to create usually 20 of each just by changing their name, alias, one column name and one columns sort style. I want to automate this or I will be crazy soon.
Do you know a way to do it in VB.Net using Com objects? Do you know another way to do it easier?

Thank you,
Koray.
0
Comment
Question by:koray_uygun
  • 6
  • 3
  • 2
  • +3
15 Comments
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
As per I know this is not possible.

Let us see if Sjef/Tom/RR have any other plans. (They are still here)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
There's only one way: use the Notes API calls. But can you explain why you cannot standardize your views?? There are lots of intelligent things you can do with views, so they will work for everybody. Perfection is a great thing, but when it costs too much money: DON'T! My users get 80% of what they want, for 20% of the costs. I think that's a fair deal.

What is the purpose of the database, what are the views, and why do you have to add or change a lot?
0
 
LVL 15

Expert Comment

by:Bozzie4
Comment Utility
You can, in R6.

If you have Notes version 6 or up, there are the necessary classes to manipulate views.

In R5, you can also copy views from 1 database to another, but you can't change them using standard Lotusscript.

cheers,

Tom
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
I think along the lines of Jeff here. Notes API would be the solution. But yes, it will be worth the effort if you can negotiate the exisiting design to accomodate such flexibility.

What you may do is: you may have some additional flags in your documents (you will have to run agents on your existing docuemtns to make them usable as per the new design) and use those flags to conditionally select different field values from the documents.

@If(@IsAvailable(FLAG1);FIELD1;FIELD2)

If you use the flag to store multipls values, it can even act as a multipoint switch.

@If(FLAG1="Value1";FIELD1;FLAG1="Value2";FIELD2;FIELD3)

And now your views can select different field values from the document conditionally.

One problem. This doesn't help you modify your view column titles. If that is your need too, you must use an alternative solution.



0
 

Author Comment

by:koray_uygun
Comment Utility
I'll explain the reason.
- Each database is used in a different department.
- The users create documents in their department's database.
- The subjects of the documents changes from dept. to dept.
- Each view's content depends on the title of one of it's column name, this way each subject is displayed in the appropriate view. This is the reason why the views columns are different in each DB.
- The reason why the aliases must be different is because, every person that access the DB has a specific role and the access to the view depends on it's alias.
- The reason why there is 4 times more views than necessary is that, the principal view has 3 columns that can be sorted but if you simply sort, you will lose the categorisation so when you click on the column, it is another view where this column is in first place that is open.

This database strategy has been created long long time ago. I know that this strategy sucks but I will work on that as a consultant for 2 months so I can't change all the strategy. But if I can find a way to do it easily, my clients will adopt it.

So, Sjef, how do I use API? I know only VB.net and Lotus Languages. I heard that Lotus has a tool named DXL (Domino XML something) that can do this but you have to know Java...

Thank you for your help.
Koray.
0
 

Author Comment

by:koray_uygun
Comment Utility
Sorry, I do not look for a way to change the strategy but a way to go along with it for now by being able to automate as much as possible the creation of views.
0
 
LVL 15

Expert Comment

by:Bozzie4
Comment Utility
Have you got R6 ?  This is pretty important here (if you have it, you can also try the DXL stuff)
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
If you have only 2 months to complete your job, you'll have to do this the pragmatic way. Notes API is too complex to be learnt at short notice, so forget that one. Tom is right, with R6 you can design views using LotusScript, althought there are some restrictions. If you have a fairly standard view, you'll have no problem. If you have can copy some standard view and adapt it to the needs of the department using LotusScript, this might even be easier.

IF you had the time THEN I would suggest you to add some fields to each document. These fields should be filled with the values that should appear in the columns. Depending on the department, different values could be put into the column-value fields, so your view can be fixed for the column-data is in the hidden column-value fields.

I think it can be done using only ONE template database. In a month. The other month is required to write a conversion agent that automatically adds the column-value fields to the documents, if the recipe for the database is stored in a Configuration document (a Profile Document would be ideal).
0
 

Author Comment

by:koray_uygun
Comment Utility
I have seen in the Notes.net forum that it is may be possible to use Notes api with lotus script. Any idea?
0
 
LVL 15

Expert Comment

by:Bozzie4
Comment Utility
W H A T   V E R S I O N    O F   N O T E S   H A V E   Y O U  GOT ?
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 250 total points
Comment Utility
I dont; care if you only have R5.  Get a copy of Notes6 JUST TO CREATE THE VIEWS.  You can't write a really simple script, as Bozzie keeps pushing.

And yes, DXL also does this, but DXL is only present full force in R6 (there is a DXL for R5 but it is truly underwhelming).  So yo would need R6 either way.

Here's some example code you could use in R6:

Dim targetDB as new notesDatabase ( "" , "whatever")
dim view as notesView
Set view = targetDatabase.getView("some template view name")
call view.setAliases("additional alias") 'or: view.aliases(ubound(view.aliases))="replacemeht alias"
view.columns(3).formula = {@If(Check1 = "somevalue"; ValueField1; ValueField2)}
view.selectionFormula = {SELECT ExecName="John Doe"}
0
 

Author Comment

by:koray_uygun
Comment Utility
Sorry, I use 5.13 but I have installed V6 too just for this. Ok, qwaletee, i will try this code.
Thanks,
Koray.
0
 

Author Comment

by:koray_uygun
Comment Utility
Thank you very much qwaletee!! That works fine. One last question, this db created and modified with R6, will it be a problem if I use It with R5 or do I have to do something to make it compatible? (I will not use R6 specific design elements)
0
 

Author Comment

by:koray_uygun
Comment Utility
Sorry Bozzie, I should have shared the points between you and qwaletee but I have seen this possibility too late. Thank you too.
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Unless you use something that only works in R6, you can design something using R6 for an R5 or even R4 client.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now