Get orders that does not include tag

How do I get all orders that do not include a specific tag using data service?

Litium version: 8.5

You can try to use the MustNot to reverse the condition, see Data service (litium.com)

This is the code I tried. But I got help from @utku and I believed he has reported a bug for it not working. And he told me to query the “Order” object meanwhile.

private static void OrdersNotTaggedWith(FilterDescriptor<SalesOrder> filterDescriptor, string tag)
{
    filterDescriptor.Bool(b => b.MustNot(mustNot => mustNot.Tag(tag)));
}

Edit: Correction, he said to create the tags with the Order object instread of SalesOrder object so:

Change this:
_taggingService.Add<SalesOrder>(order.SystemId, "MyTag");

To this:
_taggingService.Add<Order>(order.SystemId, "MyTag");

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.