2011-01-19 3 views
1

다음 코드를 작성하여 응답 문서의 부모 UNID를 가져옵니다. 하지만 "유니버설 ID가 잘못되었습니다"라는 오류가 나타납니다. 하지만 "$ Ref"를 사용하여 doclink를 만들면 doclink를 사용하여 상위 문서에 액세스 할 수 있습니다. 상위 문서에 액세스하고 상위 문서의 필드 중 하나를 변경하려고합니다. 아무도 아무것도 제안 할 수 있습니까?Lotus Notes 용 상위 UNID를 가져 오는 동안 "유효하지 않은 범용 ID"오류가 발생했습니다.

Dim session As New NotesSession 
Dim db As NotesDatabase 
Dim uiwork As New NotesUIWorkspace 
Dim uidoc As NotesUIDocument 

Dim doc As NotesDocument 
Dim parent As Notesdocument  

Set db = session.CurrentDatabase 
Set uidoc=uiwork.currentdocument 
Set doc = uidoc.Document 

'Set parent = db.GetDocumentByUNID(doc.ParentDocumentUNID) 
Set parent = db.GetDocumentByUNID("doc.$Ref") 
'both methods are giving same error 

답변

3

doc.isresponse는 무엇을 반환합니까?

학부모는 unid를 사용하는 것이 좋습니다. 그러나

==> 설정 부모 = db.GetDocumentByUNID (". 문서 $ 참조")는

유효하지 있었어야 :

if doc.hasItem("$Ref") then 
    Set parent = db.GetDocumentByUNID(doc.~$Ref(0)) 
end if 

또는

if doc.hasItem("$Ref") then 
    Set parent = db.GetDocumentByUNID(doc.getItemValue("$Ref")(0)) 
end if 
0

감사합니다 팀 . QuerySave에서 코드를 작성했는데 정상적으로 작동했습니다. 문서가 저장되기 전에 그것을 얻으려고했기 때문에 잘못된 UNID를주고있었습니다.