lotus script

I am currently trying to create a script in which I would want to find a field, but my problem is I cant find the method to know the highlighted document in a given view.  What i mean by highlighted document is the document which is enclosed in the box when you go down the view and not the document selected(with a check mark in front)

thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi Anselm,

You dont have that in the script.
Alternatively you can bring the sorted document to the UI.

The document gets opened instead of getting selected.

Or,  if you are sorting multiple documents then you can take a collection, put them in a folder and then open the folder for the user in script so that the collection is available separately for the user.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

Since the document is hightlighted then it is treated as a selected document.

If your agent is run on selected documents then it is accessible via the NotesDatabase.UnProcessedDocuments property.

Unless, other documents are selected, in which they will take priority.

If you open the current highlighted document however then you can access it via the scrip UI classes.

@Command([EditDocument]) will open the current highlighted document rather than the selected documents.

You then have access to all the fields in that document via whatever method you need.

@Command([ToolsRunMacro]; "Run once agent using UI classes");

Hope that helps

I would do the following using UI classes
Sub Initialize
dim ws as New NotesUIWorkspace
dim uidoc as NotesUIDocument
dim doc as NotesDocument
dim item as NotesItem
dim stringVal as string

set uidoc=ws.CurrentDocument
if uidoc is nothing then
     msgbox "Please Expand the view
              pane, and try again"
     exit sub
end if
set doc=uidoc.document
set item=doc.getFirstItem("Name of your field")
if item is nothing then
end if

end sub

Now you have the text contained in a field in a string variable and now you can edit it.
When you've processed it and want to reassign the new value to the field do
      Call doc.replaceItemValue("Name of your field", SomeValue)
      Call doc.ComputeWithForm(False,False) do this if you need to comput fields based on the change you made.
      Call doc.Save(True,False,False)

that is all you need.
I think.
If my answer is sufficient deny Arunkumar's answer.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.