fake-xrm-easy icon indicating copy to clipboard operation
fake-xrm-easy copied to clipboard

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

Open sly83 opened this issue 1 year ago • 0 comments

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 avatar Dec 21 '23 08:12 sly83