Hi,
Here is the scenario. I have number of views in my database and all these views have a button on it like “Create Request”. This button is supposed to compose a document using a form.
On the form, there is a “Save & Send” button. This button saves the document and sends email along with a .ndl attachment to the users MS Outlook inbox.
In the “Send email” agent for creating .ndl attachment, I have to create a ViewLink, so I put a view name in there, but for some users who use terminal servers, unless they create the new request from the same view (as in the send email agent), they cannot launch the ndl attachment from outlook to open the request they created in this Lotus notes database.
Example: The “Send email” agent gets executed when the “Save & Send” button is pushed. The agent has, for example, “View1” hard coded in it, the users who use terminal servers have to create new requests only from this view and not from any other views for the ndl attachments to work correctly.
Now my question is, I want them to be able to use any view and still the ndl attachment should work correctly. So, in the agent for sending email , instead of the view name hard coded, I want the code to figure out the name of the View from where a particular request was created.
I read about globals on the form, but I am not sure how to use it. I wrote the following code for getting currentview name, but I don’t know how to pass the view name value to a hidden field on the form. I want to pass the view value to a hidden field on the form and then to the send email agent. I don’t how to do that though, since I don’t know how to pass the value of the Current view into the hidden field. I tried putting the code in the querysave event, but it doesn’t work.
Dim wks As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim doc As Notesdocument
Dim uidoc As NotesUIDocument
Set uidoc = wks.CurrentDocument
Set uiview = wks.CurrentView
viewName$ = uiview.ViewName
Any help is appreciated.
Thank you,
Archana