Tuesday, July 4, 2017

Sitecore Commerce Server search criteria Model is not valid

When updating a user's profile on Sitecore commerce server (general details and a multi-valued address field), the following error occurred when the update operation executed.
The operation service has encountered an error while processing the request.  The error details have been logged by the service.Microsoft.Commerce.SequenceComponents.Exceptions.InvalidOperationRequestException: The operation could not be performed because the search criteria Model is not valid.  The search criteria Model must contain exactly one property that maps to a Commerce Server profile property defined as a primary, join, or unique key.
The update model is shown below:
Sitecore Commerce Server update model
The problem came down to an automapper error, where the two related update operations (related to the addresses object) did not have a valid ID added for existing addresses. So effectively an update operation was passed through without the ID of the address relationship being updated.

No comments:

Post a Comment