I'm trying to use web api query and without fetchxml, I was able to build this endpoint but the resultset is behaving like LEFT OUTER JOIN, but I need INNER JOIN.
new_demo is having lookup of new_currentappointment (most recent record is captured in here from a subgrid list), new_currentappointment is having new_user lookup.
I want the list of new_demo with new_currentappointment_lookup where new_user_lookup is the filter.
https://crmdev.crm.dynamics.com/api/data/v9.1/new_demo?$select=new_attribute_one&$expand=new_currentappointment_lookup($select=new_attribute_two;$filter=_new_user_lookup_value eq <guid>)
The result is bringing the every single new_demo in the system, but the expand filter only results null. How to eliminate the filtered null result from expanded entity in main result?
"value": [
{
"@odata.etag": "W/\"608177550\"",
"new_attribute_one": "Demo 1",
"new_currentappointment_lookup": {
"new_attribute_two": "testing comments",
"_new_user_lookup_value": "guid",
},
},
{
"@odata.etag": "W/\"608177790\"",
"new_attribute_one": "Demo 2",
"new_currentappointment_lookup": null,
}
]
This result explained in ASP.NET web api documentation is what I'm looking for, but I could not find one for Dynamics CRM web api. Any other easy way I'm missing?