Solved

View question

Posted on 2004-09-29
20
294 Views
Last Modified: 2013-12-18
Hi,

Have two forms. in the first form named 'Client' i've a numeric field called Client ID and address information details (like address1, address2, city, state, zip, zip-ex etc).

Now I've another form 'Clientnumbers'.  I've two fields in this form. First field is the Client ID and the second field is Client numbers (cnum) a multi-value field.
 Cnum can contain values upto 100.

Now lets say I've a 'Cleint' form which has the Client ID as MCI100 and the address information details.
Now I've a 'Clientnumbers' form which has Client ID as MCI100 and all the Client numbers in it.

The requirement is I've to show a view which will show all the Client numbers in the first column from Clientnumbers form and the address details from 'Client' form in the other columns.
I've to join the ClientID to source.

basically the first column in from Clientnumbers form. and the other columns are from Client form.

any advices
thanks
0
Comment
Question by:sridevi911
  • 9
  • 6
  • 4
  • +1
20 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12179327
Each row in the view will represent a document..

So you will get multiple times the client details if you categorize on second doc. one way is to turn it around. First show the client form and then categorize client numbers unerneath it.

~Hemanth
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12179331
A bit blunt: impossible in Notes. That's one of the "advantages" of a non-relational database.

1. Is it possible to combine the two forms into one? Or is it historically grown this way?
2. You could have a view where both forms are shown, categorized. Come to think of it: don't.
0
 

Author Comment

by:sridevi911
ID: 12179428
the first column in the view which is Client numbers is a mult-value field and i want to show it as show multiple values as seperate entries.  I know for each entry
the 2nd columns repeats in some cases. this is what i want.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12179554
.. you can endup with blank rows of the second form where client details is missing !!
0
 

Author Comment

by:sridevi911
ID: 12179565
also, its not possible to combine two forms. it grown historically.

all i want to show is the first column will show the Client numbers from Clientnumbers form and the second column should show the address information from the Client ID form.

thanks
0
 

Author Comment

by:sridevi911
ID: 12179577
yes, i tried and i'm ending up with blank information in the second column. but that is not good for me. I want the address info from Client Id form in the second column.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12179865
Hemantha, please say that it's not possible to combine data of two different documents on one line in a Notes view. If you want to do it in a browser, then there are possibilities, but the result may be slow...
0
 

Author Comment

by:sridevi911
ID: 12179948
ok so can i do this. i'll create a computed field in the Clientnumbers from and will put a dblookup formula to get the address details from a view based on this documents Client ID.

in this way i can show the details in the second column in the view. Let me know if this is a good approach.  

But one problem would be that, if the address informationis changed in the client form then this document should be saved again.

please let me know if this is good
thanks
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 20 total points
ID: 12180162
Indeed. You'd have to update all documents, all the time.

The best way to create some sort of relation between documents is to use a document hierarchy, a document-response relationship. In that way, there are still 2 documents, you still need 2 lines in a view, but you can present the data in a nicely structured way.

Sadly, in this historically grown situation you will not be able to convert everything. In a Notes database, there usually is quite some data redundancy, and you sometimes need agents to maintain the correctness of the database. Such is life...
0
 

Author Comment

by:sridevi911
ID: 12180281
ok, so i'm using dblookup which is working fine.  But it true that when ever the main document changes i've to update all the client numbers documents.

since, i'm having only two fields in the client numbers documents, i'm planning to schedule an agent which will save all the clientnumbers documents once every day.
in this way i can have all the changes reflected in the clientnumbers dblookup field
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12180493
You can write an agent which will run toolsrefreshalldocs . IN the open event of the view run this agent. This will recompute the dblookups. (The dblookup fields should be computed fields) ,... this approach might annoy users. Another way is to use computewithform method .. this scripted agent can then made to runonserver on open of the view

Sjef, that is what I was trying to tell.. but not bluntly though !!
0
 

Author Comment

by:sridevi911
ID: 12180557
Hemanth,

Let me understand this clearly. I'm planning to schedule a server agent which will runs when docs are created or modified. This will just do refreshdocs in the clientnumers form.
how will it annoy users. the users will not even know as this is a server agent.

please advise.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12180642
It is not your scheduled agent ! It is about the front end agent which is called only when the user opens the view.. So that you don't have to run scheduled agent and eat up the server resources.

The second approach does the same but it is called only when the view is opened by the user...My intent is to not schedule agent but call it on demand
0
 

Author Comment

by:sridevi911
ID: 12181289
need a little coaching. how can i run an agent when the user opens the view. does the user has to click a button in the view or it is automatically run whenever the
user opens the view.

thanks
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12181841
Hemantha,

Don't you think it's better to do the following:
- call the agent only once, ever, to create the fields ; the agent can be called again to check or correct the fields
- add a small piece of LS in form A that will modify the documents of form B when keys are changed; there is no use in running the agent every time the view is opened; only when a key is changed the referring document must be updated

So when you save the document, you need to know:
- the old value of the key(s)
- if the current value has been changed
-   find the referring documents in a view
- update only those documents
0
 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 30 total points
ID: 12182902
Do it this way:

Create a view of the CLIENTNUMBERS form, called CLIENT_NUMS_BY_ID, which is CATEGORIZED on Client ID in the first column, with the second column showing the client numbers.

Now, create a very compact copy of the CLIENT form called CLIENT_WITH_NUMS.  It should have a table with two columns.  The second column contains teh address info.  The first column contains an embedded view, the CLIENT_NUMS_BY_ID view, show single category formula set to Client ID.  Make sure data can't be saved using this form.

Create a second view.  This one should have a selection formula to show CLIENT documents, but a form formula to display them using the CLIENT_WITH_NUMS form.

Now, when one opens a single client using the second view, he sees the client address AND client nums in teh same screen, as requested.  To see a "report," put a button in the view called REPORT CLIENTS WITH NUMBERS.  It will have the following code:

@COmmand([EditSelectAll]);
@Command([FIlePrint]);
@Command([EditDeselectAll])

Using the button, the print dialog appears.  by default, it will print everything selected using the alterante form, since this view has the form formula.  In R6, I think you can do a print preview.

Otherwise, use NotesSQL to build a report in Access.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12182917
That is indeed a good idea too !

But I don't know whether there is some kind of document restrictions ?

Sridevi, Use script to run the agent.. use Agent.RunOnServer method in the QueryOpen of the view (or database)
0
 

Author Comment

by:sridevi911
ID: 12183463
qwaletee, thanks but i've all ready created a dblookup field in the clientnumbers form.  

Hemanth, do you have an example of agent.runonserver metod.
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 50 total points
ID: 12184579
Simple

Dim s as New NotesSession
dim db as NotesDatabase
dim ag as notesAgent

set db = s.CurrentDatabase
set ag = db.GetAgent("RefreshAgent")
ag.RunOnServer

PS: This agent should be signed with proper access so that it can run on server. For logging use print statements which will directly write to log.nsf on server
0
 

Author Comment

by:sridevi911
ID: 12184621
great, thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

20 Experts available now in Live!

Get 1:1 Help Now