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

Hotfolder-Impex -CSV -1 row multiple items -promotions and price row

Hi , I am facing issue while processing a csv file via hot folder (Promotion automation via hot folders) : Requirement is i want to create a fixedpromotion from excel and insert its prices . Models are :ProductFixedPricePromotion and ProductFixedPricePromotion and what i have done is in hot folder xml file i configured like this :

     <property name="header">
         <value># ImpEx for Importing Prices into $CATALOG$
             $defaultPromoGrp=default
             $productCatalog=indiskastoreProductCatalog
             $catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
             #% impex.setLocale(Locale.ENGLISH);
             INSERT PromotionPriceRow;Currency(isocode);
         </value>
     </property>
     <property name="impexRow">
         <value>


             ;{7};{8};

         </value>
     </property>
 </bean>

 <bean id="indiskaBatchFixedPromotionConverter" class="com.indiska.core.batch.converter.impl.DefaultImpexConverter">
     <property name="header">
         <value># ImpEx for Importing Prices into $CATALOG$
             $defaultPromoGrp=default
             $productCatalog=indiskastoreProductCatalog
             $catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
             #% impex.setLocale(Locale.ENGLISH);
             INSERT_UPDATE ProductFixedPricePromotion;PromotionGroup(Identifier[default=$defaultPromoGrp]);enabled[default=true][unique=true];code[unique=true];title;description;priority;products(code,$catalogVersion)[mode=append][unique=true];startdate;enddate;productFixedUnitPrice(price,currency(isocode))[cacheUnique=true]


         </value>
     </property>
     <property name="impexRow">
         <value>

             ;;;{+0};{+1};{+2};{3};{4};{5};{6};{8}:{7};

         </value>
     </property>
 </bean>

so for a single row in csv i can insert two items here .And if the price is unique then its working fine other wise it is throwing exception :

like : if insert first time 50-EUR --it works. Second time if i execute the same it is throwing the following exception : [CronJobErrorHandler] line 12 at main script: Exception ocurred, will ignore: de.hybris.platform.impex.jalo.ImpExException: more than one item found for '12.51:EUR' using query ' FROM {PromotionPriceRow AS t0} WHERE {t0.price}=?v0 AND {t0.currency} IN ({{ SELECT {t1.pk} FROM {Currency AS t1} WHERE {t1.isocode}=?v1 }})' with values {v0=12.51, v1=EUR} - got at least 8825322115988 and 8825322148756[HY--1] INFO | jvm 1 | main | 2018/03/01 12:44:55.830 | de.hybris.platform.impex.jalo.ImpExException: more than one item found for '12.51:EUR' using query ' FROM {PromotionPriceRow AS t0} WHERE {t0.price}=?v0 AND {t0.currency} IN ({{ SELECT {t1.pk} FROM {Currency AS t1} WHERE {t1.isocode}=?v1 }})' with values {v0=12.51, v1=EUR} - got at least 8825322115988 and 8825322148756[HY--1]

Error is saying "after insertion in promotionpricerow and impex has to add its reference to fixedpromotion model but it is finding more than one pk for the same price and currency .

Unfotunalty in promotionpricerow there is no unique otherwise i would have fetched pricerow(code) . but no unique key is there ..

alt text

alt text

Please help me out .

10465-felx1.png (20.0 kB)
10466-felxi2.png (45.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

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.