Lookupall vs. Lookupalldouble: Parameter contains an error

I use lookup often, but rarely lookupall and even more rarely any of its variants. I can’t figure out what I’m doing wrong here. The first line of code works: I see two items, separated by a paragraph break. The second line of code gives me “Parameter contains an error.” The only difference in the parameters is the sixth parameter, which is a space enclosed by quotes, exactly like the example in the documentation.

displaydata lookupall("SubWizard",«OrderNo»,OrderNo,«Item to Ship»,¶)
displaydata lookupalldouble("SubWizard",«OrderNo»,OrderNo,«Item to Ship»,«Qty»,¶," ")

Note that OrderNo is a text field in both databases–I specifically changed it to a text field in order to get this lookup to work. Item to Ship and Qty are both numbers, but I don’t think that should matter. In any case, I tried converting them to strings like so, and get the same error:

displaydata lookupalldouble("SubWizard",«OrderNo»,OrderNo,str(«Item to Ship»),str(«Qty»),¶," ")

Those two parameters are both being used to name the data fields. The names are text. Without the str( function you were telling Panorama that the numbers contained in those fields were the names of the data fields. When you added the str( functions, you told it that the numbers converted to text were the names. What you want to do, is put quotes around those names, instead of chevrons.

lookupalldouble("SubWizard",«OrderNo»,OrderNo,"Item to Ship","Qty",¶," ")

You’re giving me hope, because the quotes/noquotes/chevrons often screws me up so I wouldn’t be surprised if that’s a factor here… however, I tried the suggested change, and still get the same error.

displaydata lookupalldouble("SubWizard",«OrderNo»,OrderNo,"Item to Ship","Qty",¶," ")

I answered too quickly. You actually need to put quotes around the names of all of those fields where you have chevrons.

lookupalldouble("SubWizard","OrderNo",OrderNo,"Item to Ship","Qty",¶," ")

Chevrons work for lookupall( because an exception was made to the usual syntax rules to make it easier for users like you, but lookupalldouble( is a custom function, and custom functions are a lot more generic. There aren’t any exceptions for special cases.

Aha, that did it! Thank you for your help.