Skip to Content
author's profile photo Former Member
Former Member

Ambiguous unique keys exception when changing Product in OrderEntry

Here is my impex content to update product code in order entry

INSERT_UPDATE OrderEntry;order(code)[unique=true];entryNumber[unique=true];product(code ,catalogVersion(catalog(id[default=xxcProductCatalog])version[default=Online]))[unique=true];quantity;unit(code);namedDeliveryDate[dateformat=yyyyMMdd];estimatedGrossPrice;estimatedItemTotal;totalPrice;scheduledDate[dateformat=yyyyMMdd];deliveryNote;certificateOfAnalysis;invoices(code);plant(UID); **;A_0001319965;00010;A_000000000000200005;**25000.000;KG;20160817;0.00;0.00;0.00;20160716;;;;A_A020;

i am trying to update the product code "A_000000000000200009" with "A_000000000000200005" , i am getting the following exception

18.08.2016 10:15:28: ERROR: line 2 at main script: line 2: cannot create OrderEntry with values ItemAttributeMap[ registry: null, type: , data: {product=Product 'A_000000000000200009' (8796093415425), unit=Unit 'KG' type 'weight' (8796096462858), totalprice=0.0, order=A_0001319965(8796093251629), estimateditemtotal=0.0, nameddeliverydate=Wed Aug 17 00:00:00 CEST 2016, deliverynote=null, scheduleddate=Sat Jul 16 00:00:00 CEST 2016, certificateofanalysis=null, entrynumber=10, estimatedgrossprice=0.0, plant=A_A020[8796127428613], quantity=25000, invoices=[]} ] due to [de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@6a041ccc]:ambiguous unique keys {entryNumber=10, order=OrderModel (8796093251629)} for model OrderEntryModel () - found 1 item(s) using the same keys 18.08.2016 10:15:28: ERROR: line 2 at main script: Exception 'line 2: cannot create OrderEntry with values ItemAttributeMap[ registry: null, type: , data: {product=Product 'A_000000000000200009' (8796093415425), unit=Unit 'KG' type 'weight' (8796096462858), totalprice=0.0, order=A_0001319965(8796093251629), estimateditemtotal=0.0, nameddeliverydate=Wed Aug 17 00:00:00 CEST 2016, deliverynote=null, scheduleddate=Sat Jul 16 00:00:00 CEST 2016, certificateofanalysis=null, entrynumber=10, estimatedgrossprice=0.0, plant=A_A020[8796127428613], quantity=25000, invoices=[]} ] due to [de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@6a041ccc]:ambiguous unique keys {entryNumber=10, order=OrderModel (8796093251629)} for model OrderEntryModel () - found 1 item(s) using the same keys' in handling exception: line 2: cannot create OrderEntry with values ItemAttributeMap[ registry: null, type: , data: {product=Product 'A_000000000000200009' (8796093415425), unit=Unit 'KG' type 'weight' (8796096462858), totalprice=0.0, order=A_0001319965(8796093251629), estimateditemtotal=0.0, nameddeliverydate=Wed Aug 17 00:00:00 CEST 2016, deliverynote=null, scheduleddate=Sat Jul 16 00:00:00 CEST 2016, certificateofanalysis=null, entrynumber=10, estimatedgrossprice=0.0, plant=A_A020[8796127428613], quantity=25000, invoices=[]} ] due to [de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@6a041ccc]:ambiguous unique keys {entryNumber=10, order=OrderModel (8796093251629)} for model OrderEntryModel () - found 1 item(s) using the same keys

The same update when tried to hMC its working, Can any one suggest how do i update product code if the OrderNumber and EntryNumber are unique for a particular order?

Thanks Sebin

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 18, 2016 at 01:02 PM

    Hi,

    You should not define the product as unique.

    INSERT_UPDATE OrderEntry;order(code)[unique=true];entryNumber[unique=true];product(code ,catalogVersion(catalog(id[default=xxcProductCatalog])version[default=Online]));quantity;unit(code);namedDeliveryDate[dateformat=yyyyMMdd];estimatedGrossPrice;estimatedItemTotal;totalPrice;scheduledDate[dateformat=yyyyMMdd];deliveryNote;certificateOfAnalysis;invoices(code);plant(UID);

    Cheers

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.