Must be stupid, but

Does anybody have any clue for this http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/79edb53a9f2c83808525728900736be7?OpenDocument?

Thanks

Subject: Must be stupid, but…

Just embed a view that displays the data the way you want it to show. If a person logs on and is not in the readers field of the document in that view, that document simply wont display.Only documents that have the user in the readers field will display.

Subject: RE: Must be stupid, but…

Thanks for answering Hughster, but I have a doubt.

I had already though about using an embedded view.

My question is how will I hide undesired information from the embedded view?

Let me try to explain.

If you access the view, you can see, for example, 4 docs:

Paul, John, Mary and Alice.

But the Main doc, the one that will access the embedded view through a button, has only 2 of these names: Paul and Alice.

So, when you press the button, you’ll see ONLY Paul and Alice information (and not all of them!).

Thanks once again for any tip.

Regards,

Renan

Subject: RE: Must be stupid, but…

Then you need to write an agent that returns only the information you want and prints it to the screen in html format

Subject: RE: Must be stupid, but…

Hi Hughster,

The code below works for one doc only, displaying the phone number if the person can read the document in the view:

Sub Click(Source As Button)

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase

Dim view As NotesView

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document

user$ = doc.Name(0)

Set db = session.CurrentDatabase

Set view = db.GetView(“VIEW”)

Set doc = view.GetDocumentByKey(user$, True)

If doc Is Nothing Then

Messagebox “You cannot see home phone number or it’s empty.”

Else

Messagebox "Phone number " + doc.Phone(0)

End If

End Sub

So, if the Main doc contains information about Paul and I click on the button, then I’ll see his phone number.

Now, if the Main doc contains information about Paul, John and Mary, how can I achieve the same result, doing something similar?

Suppose that the “VIEW”, the one that is categorized in the first column by the user and the second column has the phone number, has 5 docs:

Paul, John, Mary, Alice and Willian

If you can give me some direction, I’d appreciate it a lot.

Thanks once again

Renan

Subject: RE: Must be stupid, but…

Add:Dim AItem As NotesItem

Dim aValues As Variant

Set AItem = uidoc.GetFirstItem( “namesfield”)

aValues = AItem.Values

Dim x%

For x = 0 To Ubound(aValues)

’ This will now take each name in your namesfield

’ so in here, put your code that does a look up to the view

’ and brings back the info, after checking that the user is

’ in the docs reader field.

'aValues(x) will hold the individual value, so…

Set doc = view.GetDocumentByKey('aValues(x) , True)

If doc Is Nothing Then

Messagebox “You cannot see home phone number or it’s empty.”

Else

Messagebox "Phone number " + doc.Phone(0)

End If

Next

Subject: RE: Must be stupid, but…

Thank you very much Hughster.

I haven’t tried your code yet, but it sounds clear to me.

Thanks once again.

Regards from Brazil,

Renan

Subject: RE: Must be stupid, but…

Hope it helps. I will check this thread for the next few days, so if any problems, just post it here. Anyway, its the least a South African on an Austrian passport living in London can do.