Problems with @InheritedDocumentUniqueID

We have a problem with response documents linking to their parent documents. Our CMS uses parent documents for the company profile, and below the company document we have person profiles as response documents to that company. The person document contains a doclink field to the parent company (with @InheritedDocumentUniqueID as value).

We have imported the data from our old CMS system, but on the imported docs the doclink field doesn’t work - nothing happens when you click on it. When we make a new person document (=response document) the doclink works alright.

The same sort of problem occurs when we cut a person doc and paste it below another company doc (= the person works for another company). The doclink doesn’t change to the new company doc, but keeps referring to the old company.

How can we get this doclink to work properly? Any ideas are very much appreciated.

Best,

Harmen.

Subject: Problems with @InheritedDocumentUniqueID

Sounds like your import procedure changed the document ids and maybe also lost the response heirarchy.

The doclinks will have to be recreated to point to the correct documents. This also applies when moving people from one company to another.

HTH.

Mark.

Subject: RE: Problems with @InheritedDocumentUniqueID

Hi Mark,

Thank you for your reply. Can you give a hint on how to recreate the doclinks? Editing & saving the documents doesn’t work, so I am stuck on how to do this.

Best,

Harmen.

Subject: RE: Problems with @InheritedDocumentUniqueID

Harmen,

Assuming your Person document has a rich text field called “Link” where your doclink normally goes, then get a handle to the Company document you want to link to and:

Dim rti as NotesRichTextItem

Dim rtnav as NotesRichTextNavigator

Dim rtlink as NotesRichTextDocLink

'Check for doclink in Link field

Set rti=docPerson.GetFirstItem(“Link”)

Set rtnav = rti.CreateNavigator

If Not rtnav.GetFirstElement(RTELEM_TYPE_DOCLINK) Then

Messagebox "No doclinks in Link item",, "No doclinks"

Exit Sub

End if

'Remove existing doclink

Set rtlink = rtnav.GetElement

Call rtlink.Remove

'Add new doclink

Call rti.AppendDocLink(docCompany, “Click to view Company”)

Call docPerson.Save(True, False)

(Not tested)

Also see the help example for NotesRichTextDocLink class.

HTH.

Mark.

Subject: RE: Problems with @InheritedDocumentUniqueID

FYI: Doclinks don’t have to be put in RT fields if that’s all a text field contains.

Subject: RE: Problems with @InheritedDocumentUniqueID

Another FYI: doclinks to parent documents need not be stored in the document; you can use the $REF field as the value for a CFD text field, and it will become a doc link to the immediate parent. Creating a link to the main document from a lower-level response is more complex, but it can be done using the new looping features of the formula language.