Formula experts: can you solve this problem

In a form I have 1 editable hidden text field (h1)and 1 rich text field which is hidden for a particular value of h1. now on click of an action button the following things should happen in order

  1. the value of h1 will be changed so that rich text field become unhidden

  2. focus the rich text field and view the attachment

  3. change the value of h1 again so that the rich text field hides

this form is only available in Notes client

I have written the following code

@Command([EditDocument];1);

@SetField(“h1”;“yes”);

@Command([ViewRefreshFields]);

@Command([EditGotoField];“h1”);

@Command([AttachmentView]);

@SetField(“h1”;“no”);

@Command([ViewRefreshFields])

but this is not working.

May be due to some formula preference problem

Any body has any idea how to do this.

Subject: Formula experts: can you solve this problem

I wouldn’t hide / unhide the rich text field . RTFs are a bit funny in relation to hide-whens.

What exactly are you trying to achieve?

Subject: Formula experts: can you solve this problem

Hi,

Do you really need to unhide the RT field only to hide it again?

Have you tried this?

@Command([OpenDocument]);

@Command([EditGotoField]; MyRichTextField);

@Command([AttachmentView]);

/Michael

Subject: RE: Formula experts: can you solve this problem

Thanks you for your response.

Actually my objective is by pressing an action button view one attachment which is attached in a hidden Rich text field.

Whatever steps I have told I think that is the only way to do this and I have seen that this is possible when I perform the steps manually.

only problem I am facing when doing that thorugh formulae.

Subject: Formula experts: can you solve this problem

Madan, here is an example of how to do something like this in LotusScript. I only went as far as to get a handle on the attachment - you have to decide what to do after that. LotusScript is my preferred way of coding most buttons… not sure about the hide when. I don’t think I would do that. I would rather have a controlled access section that I could collapse, and use the access formula for controlling access to the content. Plus I believe that a button could still manipulate a field in a rich text field that is in a controlled access section, but I haven’t specifically tried that. You may also try manipulating the attachment without unhiding the field - although I’m not sure what it is you are trying to do.

Hope this helps!

Trish

Dim uiws as New NotesUIWorkspace

Dim uidoc as NotesUIDocument

Dim doc as NotesDocument

Dim FieldName as String

Dim FileName as String

Dim rtitem as NotesRichTextItem

Dim obj as NotesEmbeddedObject

FieldName$ = “Compensation”

FileName$ = “2008SalaryReport.xls”

Set rtitem = New NotesRichTextItem ( doc , FieldName )

Set uidoc = uiws.CurrentDocument

Set doc = uidoc.Document

Set obj = rtitem.GetEmbeddedObject( FileName$ )

Subject: RE: Formula experts: can you solve this problem

Hi Tricia,

The problem is that after getting the embeddded object there is no way to display the object in Lotus file viewer.

And I have to show this file in Lotus file viewer only so that user will not be able to save the file in his local machine.

So do you have any idea, how that can be done ?

Subject: RE: Formula experts: can you solve this problem

The user may not be able to save the original file through the viewer, but the user can certainly save anything he/she can see in the viewer. You are going through a lot of trouble (and, no doubt, really annoying your users with an unnecessary fidelity loss) to accomplish absolutely nothing.