where item.PageReferenceString == PageRefAsString(pageRef)
I didn’t get the error. I guess there are something with what get executed or evaluated first, or something. But if you get this error message: Methods not supported for type System.Object. Maybe this is your problem, and you can save your self some time debugging it . Cause I used some time before I finally got it to work.