This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


May 25, 2018, 12:05 AM
2 Posts

Invalid Universal ID error

  • Category: Domino Designer
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: ParentDocumentUNID
  • Replies: 1

Have a need to get the value of the parent document's field name BeneficiaryName for the child doc.  Here is my code...

Sub Postopen(Source As Notesuidocument)
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Dim ParentDoc As NotesDocument
    Dim parentUnid As String
    
    Set db = session.CurrentDatabase
    Set doc=source.Document    
    
    parentUnid = doc.ParentDocumentUNID

===>>>    Set ParentDoc = db.GetDocumentByUNID( ParentUnid )

    doc.BeneficiaryName = ParentDoc.BeneficiaryName(0)
    Call doc.Save(True, False)
    Call source.Refresh
    
End Sub

It errors out when I try to use ParentUnid to get the value for the child doc.

Does anyone see what I'm doing wrong?

Help appreciated!

Marcus

May 31, 2018, 11:40 PM
323 Posts
When are you trying to run it? Oh. PostOpen?

Tell ya what. There's inheritance for when you first create a document, I'd suggest you use inheritance to get the BeneficiaryName the first time, and avoid it when creating the document.

You can change the value on PostOpen when the document already exists; I just remember needing inheritance to get the value when creating the doc.

I don't remember what was happening but I do remember a similar issue.

You could also try refreshing the UIDoc before you try to get the parentDocumentUNID.

And you could also look at the parentUNID, and not use the value if it's blank.

But I remember eventually just inheriting it.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal