commercetools/commercetools-dotnet-core-sdk

Query with Nested Custom Fields

jgnatenko opened this issue · 2 comments

Hi,

I have the following problem:

Task: get Customer, that has KupCustomerNumber nested in custom field Adresses->AdditionalAddressInfo (This is field contains custom Object).

Solution:
In normal situation for retrieving Customer we could use lambda expression like:
command.Where(s => s.Addresses.Any(m => m.AdditionalAddressInfo.Contains("CustomerNo:" + customer.KuPCustomerNo + """)));

Could you please say me if that possible to do with your current solution like:
command.Where("custom(fields(Addresses(AdditionalAddressInfo(CustomerNo ="" + customer.KuPCustomerNo + ""))");

Thanks!

This is not possible as the custom fields can't have nested fields.

Thanks!