Posts tagged ‘exception’

Unusual Exception When Extending Profile System

I started with adding a relationship for customer attributes to the UserObject.

I ran through the regular steps, extending this, processors, translators, etc…. My query opertion was working great, my create also worked well. So then when I went to add the Delete and Update operations… all Exceptions broke loose.

Type : Microsoft.Commerce.Providers.Exceptions.InvalidOperationRequestException, Microsoft.Commerce.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Message : 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.

I was very frustrated with this exception as it didn’t point to much, so i continued digging and eventuall found the issue. The issue was in my MetaDefinitions.xml file, and it was a rather simple one:



        
          

            
              
              
              
              
          
        
      

      

What was happening was that my ID field had the improper casing. This was causing the Sequence Component to throw an exception when it went looking to translate the Attribute metadata to the commerce data with the primary key. Fixed the casing and it works like a charm.