This project has moved. For the latest updates, please go here.
1

Closed

InnerJoin Method almost working

description

Hi thanks for the Camlex.net brill piece of software.
I'm working on Camlex.Client 2.2.

This is my query here

var caml =
            Camlex.Query().
            InnerJoin(x => x[CesaDocument.DocType_field].PrimaryList(CESAContext.Documents).ForeignList(CESAContext.DocumentType)).
            Where(x => (string)x[CesaDocument.RiOID_field] == id).
            Scope(ViewScope.RecursiveAll).ToCamlQuery();
It compiles and that works find but the Join code is placed at the end of the query string like so..

<query>
<where></where>
</query>
<join>

</join>


This doesn't want to work in sharepoint 2010, which I'm working with.
If you put the <join></join> at the top then it works (in my tester).

Thanks for your help.
Richard
Closed Dec 3, 2016 at 8:49 AM by sadomovalex

comments

rhousham wrote Nov 18, 2016 at 11:24 AM

Sorry I thought that was the issue, but still doesn't want to work.

The problem with Joins is that it doesn't want to work when you put them in the view field.
They have to be kinda on there own.

Right - ok 'lightbulb!' getting somewhere.

rhousham wrote Nov 21, 2016 at 10:40 AM

Fixed with this code.

var caml =
            Camlex.Query()
            .InnerJoin(x => x[CesaDocument.DocType_field].ForeignList(CESAContext.DocumentType))
            .Where(x => (string)x[CesaDocument.RiOID_field] == id)
            .Scope(ViewScope.RecursiveAll)
            .ToCamlQuery();
This gives the right caml query.
No bug! Sorry ;)

sadomovalex wrote Dec 1, 2016 at 6:01 PM

rhousham,
sorry for late reply, somehow I missed your question in the inbox. Glad that it works)

rhousham wrote Dec 2, 2016 at 9:31 AM

Thanks, no worries.

FYI was working with it when I suddenly worrried about escaping characters!
Turned out that Camlex does it out the box!

Great software, a real asset.

sadomovalex wrote Dec 3, 2016 at 8:49 AM

Great to hear, thank you)