2014年11月27日 星期四

[AP] 取得notesID的格式 @Name

UserName = "CN=Mesha lin/O=ChipMos"
@Name([CN]; UserName) = "Mesha Lin"
@Name([ABBREVIATE]; UserName) = "Mesha Lin/ChipMos"
@Name([CANONICALIZE]; UserName) = "CN=Mesha lin/O=ChipMos"

-
This agent displays the Common, Abbreviated, and Canonical properties of the user name.
dim nam as NotesName
Set nam = session.CreateName(session.UserName)
REM Display common, abbreviated, and canonical formats
msg = nam.Common & Chr(13)    '//"Mesha Lin"
msg = msg & nam.Abbreviated & Chr(13)     '//"Mesha Lin/ChipMos"

msg = msg & nam.Canonical    '//"CN=Mesha lin/O=ChipMos"

-
@V3UserName  的用法同 notesSession.UserName
回傳值為"CN=Mesha lin/O=ChipMos"

Dim txtItem As Variant, UserID As String, varCurrEmpInfo As Variant
Const Macro$ = "@V3UserName"
txtItem = Evaluate(Macro$)
UserID = Ucase(Cstr(txtItem(0)))
varCurrEmpInfo = GetEmpInfoByNotesId(UserID)
-
commonName$ = notesSession.CommonUserName
return value = "Mesha Lin"
name$ = notesSession.UserName
return value = "CN=Mesha lin/O=ChipMos"

-




Set UserDoc = New NotesDocument(Sourcedoc.ParentDatabase)
UserDoc.Form = "Form-SwitchUserName"
UserDoc.UserName = SourceDoc.GetItemValue("NowSigner")
Call UserDoc.ComputeWithForm(True, True)

Call SourceDoc.ReplaceItemValue("Authors", UserDoc.CanonicalizeUserName)

沒有留言:

張貼留言