rappen / FetchXMLBuilder

FetchXML Builder for XrmToolBox and Microsoft Dynamics 365 / CRM
https://fetchxmlbuilder.com/
GNU General Public License v3.0
134 stars 55 forks source link

Fix C# code generation for linkentities with OR root filter #927

Closed Suxsem closed 1 year ago

Suxsem commented 1 year ago

Hi,

we have noticed that when a link entitiy has its root filter set to the OR type, despite the fetchxml being correct, the generated QueryExpress C# code is not. It does not create a new filterexpression and the default one is of type AND.

This PR fixes the issue by appling the same logic used for OwnersType.Sub also for ownerType == OwnersType.Link (only when filter is of type OR and there is at least one condition).

The following screenshot shows the generated code before and after the fix:

image

image

rappen commented 1 year ago

Thanks! Great finding the issue and resolving it 😊🙏