문제

I retrieve names from a group using formula, and put them in a field of type Names this way:

@Name([CN];NAME)

I want to manipulate this data in my code, but using Lotusscript. Can't find it at Google or Lotus Domino's Help. Is there a way I can handle this?

도움이 되었습니까?

해결책

In LotusScript there is a class named "NotesName" to do such manipulations.

If there is a field named "NAME" in you document, then the code would look like:

Dim doc as NotesDocument
Dim nnName as NotesName
'Somehow get the document, using ws.CurrentDocument.document 
'or db.UnprocessedDocments.GetFirstDocument, depends on your situation

Set nnName = New NotesName( doc.GetItemValue("NAME")(0) )
Whatyourlookingfor = nnName.Common

If NAME is a Multivalue then you would have to write a loop to get the common- name for every element in the array doc.GetItemValue("NAME")

The next time you have a question, check out the language cross reference in the help... There it tells you, what the LotusScript- Pendant for @Name is.

다른 팁

Please try with below suggestion for getting list of person names from group.

First need to check the availability of searching group on names.nsf (All the groups are available on "($VIMGroups)" view.

if the group is available means you need to get the list of values from "Members" item

The members item have variant(list) values. So need to iterate the members for getting each value

Please refer the below sample code:

  Set namesDb=session.GetDatabase(db.Server,"names.nsf")
  Set groupVw=namesDb.GetView("($VIMGroups)")
  Set groupDoc=groupvw.GetDocumentByKey("groupname")
  persons= groupDoc.members
  Forall person In persons
    Msgbox person
  End Forall

You can use the Evaluate method. It will return you the result of a Notes Formula:

Dim result as Variant

formula$ = "@Name([CN];NAME)"
result = Evaluate(formula$)

If the formula needs to be evaluated within the context of a document, you can pass that document as a second parameter to the method.

More info here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top