Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Filters with like condition throw 'Object reference not set to an instance of an object.' #608

Open
sly83 opened this issue Dec 21, 2023 · 0 comments
Labels

Comments

@sly83
Copy link

sly83 commented Dec 21, 2023

Describe the bug
I have a couple of unit tests in which I'm using a fetch xml with like conditions.
It seems there are some issues with like operator when used in complex filters and in linked entities.
I got null reference, and I'm unable to track the issue, because the exception doesn't have any details in it.
This query works fine on the real CRM database.
Also, if I execute the same fetch xml without like filters, it works fine.

I'm using FakeXrmEasy.9, v.1.58.1

To Reproduce
The following code is the fetch xml that is executed.

<fetch returntotalrecordcount="true" aggregate="countcolumn" > <entity name="endv_projectposition" > <attribute name="endv_allocationpercentage" /> <attribute name="endv_team" /> <filter type="and" > <condition attribute="statecode" operator="eq" value="0" /> <condition attribute="endv_project" operator="eq" value="3ec34483-4843-483a-850a-39872e58ff02" /> <filter type="or" > <condition attribute="endv_team" operator="like" value="%Team One%" /> <condition entityname="endv_role" attribute="endv_name" operator="like" value="%Team One%" /> <condition entityname="endv_person" attribute="endv_fullname" operator="like" value="%Team One%" /> </filter> </filter> <link-entity name="endv_staffrequest" from="endv_projectposition" to="endv_projectpositionid" link-type="outer" alias="endv_staffrequest" > <filter> <condition attribute="statuscode" operator="eq" value="1" /> </filter> <link-entity name="endv_allocation" from="endv_staffrequest" to="endv_staffrequestid" link-type="outer" alias="endv_allocation" > <filter> <condition attribute="statuscode" operator="eq" value="340630002" /> </filter> <link-entity name="endv_person" from="endv_personid" to="endv_person" link-type="outer" alias="endv_person" > <attribute name="endv_fullname" /> </link-entity> </link-entity> </link-entity> <link-entity name="endv_role" from="endv_roleid" to="endv_projectrole" link-type="inner" alias="endv_role" > <attribute name="endv_name" /> </link-entity> </entity> </fetch>

@sly83 sly83 added the bug label Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant