Hi everyone,
I’m new to LS and I’m trying to reference a field (through Notesitem) called A$ACTION, but without any luck. I get an error message as LS can’t understand ‘action’.
I am trying to setup an agent that will search a log file for our CRM database and the data I want to search is in this particular field. Does anyone know of a way I can reference this field in LS?
Thanks, Paul
Subject: store the field name in a variable
If the field A$ACTION already exists on the highlighted document in a view, this sample code will display its contents in a popup.
fieldName$ = “A$ACTION”
Dim wks As New NotesUIWorkspace
Dim db As NotesDatabase
Set db = wks.CurrentDatabase.Database
Dim doc As NotesDocument
Set doc = db.GetDocumentByID (wks.CurrentView.caretnoteid)
Msgbox doc.GetItemValue (fieldName$)(0), 64 ,fieldName$
Subject: RE: store the field name in a variable
Hi NextHop,
Thanks for the info. Gave it a go but I think my lack of experience is against me on this one. The script I’m trying to update is:
Forall itms In mdoc.EventLost
End Forall
but I want to change EventLost with A$ACTION and LS doesn’t think its a good idea. I’ve tried a few variations to see if I could get the Notesdocument to use A$ACTION but without success. Any help with be really appreciated.
Thanks, Paul
Subject: how about GetItemValue?
Something like this:
…
'retrieves contents of NotesItem A$ACTION into
'variant fieldV
fieldV = mdoc.GetItemValue(“A$ACTION”)
'loop over all values in fieldV
Forall itms In fieldV
'do something with each value
End Forall
…
This works best if there’s only one A$ACTION item in mdoc. If multiple items have the same name, GetItemValue returns only the value of the first item.