@dblookup and a dialog list field using formula for choices

What I am trying to accomplish is a list composed of a text and the unique id for the document:(format: “title (document_id)”

Now, it looks like it could work, but I seem to be getting complete nonsense out of my dblookup with

[ReturnDocumentUniqueID]

Here’s the choice formula:

@DbLookup(“”:“NoCache”;“”:“<path_to_file>”;“<view_name>”;CustomerName;

“OfferTitle”) +" (“+ @DbLookup(”“:“NoCache”;”“:”<path_to_file>“;”<view_name>";CustomerName;

“OfferTitle”;[ReturnDocumentUniqueId] +“)”

What I get out is this:

test1 (32 numbers, causes a “Invalid unique ID”)

test2 (32 zeroes, or some repeating sequence)

test3 (either same as that of test 2 or shifted some to either direction)

Now, the actual problem arises when I try to do

Set doc = db.GetDocumentByUNID(a number within one of those parentheses)

I keep getting a “Invalid Unique ID” error with this.

Anyone have good ideas on how to solve this?

Subject: @dblookup and a dialog list field using formula for choices

I’ve tried your formula, but I choosed to write it in a different way. You might try this one.

L1 :=@DbLookup(“”:“NoCache”;“”;“ViewRefContact”;f_LastName;2) ;

L2 := @DbLookup(“”:“NoCache”;“”;“ViewRefContact”;f_LastName;2;[ReturnDocumentUniqueID]);

show := L1 + “(” + L2 + “)”;

@Prompt([OK];“Test”;show)

Subject: RE: @dblookup and a dialog list field using formula for choices

Thanks for this one, makes my code a bit more readable…

But it still doesn’t solve the problem.

Each returned entry still gives me a “Invalid Universal ID” error.