Is @DocumentUniqueID buggy for you too?

I’m trying to find the child of a document using formula language. I came up with an idea of setting up a view with two columns: Me & Child

Me uses: @Trim(@Text(@InheritedDocumentUniqueID))

Child uses the formula: @Trim(@Text(@DocumentUniqueID))

I set the sort on Me to Descending.

I have two issues. First, both columns have the same values (@DocumentUniqueID). What happened to @InheritedDocumentUniqueID???

Second, I’m trying to populate a field with the child’s DocUniqueID with:

@Text(@DBLookup(“”;“server”:“db”;“MyView”;@Text(@DocumentUniqueID);“Child”))

I figured this would take the current doc id, find it in the Me column of “MyView” and return the value of the Child column. But, the field is blank. I looked on the Domino Console, but there’s no error. Where is my value? What’s wrong?

Any help/ideas/suggestions are appreciated!

Subject: Solution to @DBLookUp problems

I had a couple of issues here that may help someone else later.

  1. The view was not sorting properly since it was set to preserve the document hierarchy. Unchecking the “Show response documents in a hierarchy” is key.

  2. To get the parents ID, don’t use @InheritedDocumentUniqueID as this will default to the same as @DocumentUniqueID when displayed in the view. Use @Text($Ref) instead. (And don’t forget to wrap @DocumentUniqueID in @Text() as well)

  3. Don’t confuse the “field name” argument of @DBLookup with the column name of the view. Field name looks at the document, and reads the field. If you are trying to pull a value out of a column of a view, use a number to specify which column you want.

I hope this saves someone else the trouble that I had. Also, a big thanks to Stephen Lister who saved me many hours of frustration as well as my sanity.

Subject: Solution to @DBLookUp problems: more to the story

Other things I’ve found:

I was only able to get the value back if I used a Computed For Display field for the lookup. Using Editable or Computed returned no value and of course, a Computed when Composed was of no use (since the child doc would never be available when the parent is composed).

Also, because the child doc won’t exist when the parent is created, make sure you use @IsError to test whether or not the lookup was successful - otherwise, Domino tells you it can’t find the page.

Subject: Is @DocumentUniqueID buggy for you too?

@InheritedDocumentUniqueID is only really valid in computed-when-composed fields when the form that uses it has “formulas inherit values” selected. At other times it returns the same thing as @DocumentUniqueID. Use @Text(@InheritedDocumentUniqueID) in a field, or @Text($Ref) in a view column to get the parent id.

Subject: RE: Is @DocumentUniqueID buggy for you too?

View works now (using $Ref), but I still can’t get the value from the view using @DBLookup. Any ideas there?

Subject: RE: Is @DocumentUniqueID buggy for you too?

Hi Todd,

Send a zipped copy of the database to me at slister@twistedreality.com.au and I’ll see what I can find for you. (Please remember to change the ACL to give at least Designer access to the Default user.) If you can leave some data in there that will help as well, but if your data is sensitive then I will dummy some up.

Stephen Lister

Subject: RE: Is @DocumentUniqueID buggy for you too?

I could be wrong – I haven’t tested this – but isn’t $REF a “funny” field. It looks like text, but isn’t (like @DocChildren et al). Which means you may not be able to do conventional @DbLookups and so forth with it.

Subject: RE: Is @DocumentUniqueID buggy for you too?

Ben, you posted to another question I had for a similar problem. You said to use an agent.

Just to let you know, this is the option I went with (good call). I have a hidden field in the “parent”. I’m calling an agent on WebQuerySave which looks at docs that have children and populates the hidden field with the DocumentUniqueID of the child.

The next time the parent is opened, I simply test the value of the hidden field, and use that to open the child. Of course, if the field is blank, I compose a new child.

I’m posting this on the slim chance that someone sees this thread and wants to know how someone else solved it. I’m sure there are other ways, but for what I need to do, this idea was the winner.

Subject: RE: Is @DocumentUniqueID buggy for you too?

I dunno – I’ve returned @Text(@DocumentUniqueId) for responses from lookups keyed on @Text(@DocumentUniqueId) in the current document to views sorted on @Text($Ref) in a dozen or so databases without difficulty. There has to have been some other problem with the lookup.

Subject: RE: Is @DocumentUniqueID buggy for you too?

do I understand correcty that you are trying to us @Dblookup in view column?? AFAIK it’s not supposed to work. Check Designer help to see which functions work where (there’s a topic called Where does this @function work)

Subject: RE: Is @DocumentUniqueID buggy for you too?

No, you are not understanding correctly (sorry if I wasn’t clear). I’m using @DBLookup in the form. The view is one of the arguments. I’m not getting a return value.

Subject: RE: Is @DocumentUniqueID buggy for you too?

If you’ve displayed @Text($Ref) in a view then return the column value in the @dblookup rather then the field value.