Control access section

Hello,

I am trying to access to a field this way:

Set oItem = thisDoc.GetFirstItem(“Name”)

This initially worked, but now I have created a controlled-access section and moved the field inside the section. This code cannot find the field.

Does anybody know how to access to the field in this new situation?

Thank you

Óscar.

Subject: Re: Control access section

I wouldn’t expect that particular line to give you an error, but attempting to set/change the item value and save the document later in the script should give you an error. That’s how it’s supposed to work, since access is now limited.

Subject: RE: Re: Control access section

I see,

But the fact is that when the user has enough rights to access the section the code fails anyway. I would expect that the code could see the field in this situation.

Thank you for your help.

Óscar.

Subject: Control access section

Can you give more information please. Where is the code running - from an agent ? a button on the form ? an event ? an action ?

In what way is it not working ? Is oitem set to Nothing ? Do you get an error ? Are the item contents blank ?

As far as I know, access controlled sections work solely at form level and should have no effect on backend LotusScript code.

Subject: RE: Control access section

The code is running in the Click event of a button, and tries to access a NotesRichTextItem to attach a document to it.

This sentence tries to retrieve a reference to the NotesRichTextItem but returns Nothing (when the item is outside the control access section everything works fine).

Sub Click(Source As Button)

Set uidoc = workspace.CurrentDocument

Set thisDoc = uidoc.Document

	

Set oPlantilla = viewdoc.getfirstitem ("Body")

Set oSitePack = thisDoc.GetFirstItem("SitePack")	

Call oSitePack.AppendRTItem( oPlantilla)

		

Call thisDoc.Save (False,True)

.......

End Sub

Thank you for your help.

Óscar.

Subject: RE: Control access section

I can’t see how this code could work as viewdoc has not been set to anything.