on 08-03-2018 5:21 AM
Hi Team,
Duplicate categories were getting created after adding mode=append in supercategories header. Kindly help me how to resolve this issue.
Example scenario: we have loaded category1 to product1, after that we are trying to add category1,category2 to product1 then dupliate categories(category1) were creating in the hybris for product1, can anyone help me how to resolve this issue.
Thanks for your response ,
Yes we can achieve it by using prepareInterceptor, but i have one more solution , we have categoryproductrelation table in OOTB and i am planning to create product and in the same ImpEx i will map category to product using categoryproductrelation table so in this case if we receive multiple updates with same category then instead of appending it will map only one category.
Any thoughts.
Thanks,
Suresh G.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The best way i can see is to write a prepareinterceptor and there you do lie this
product.setCategories(Set(product.getcategories))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Write a translator on supercategories field , so that it checks duplicacy before associating categories to product. Let me know if it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Insert the relationship directly to enforce uniqueness of both the source and target.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh
you can do the following
INSERT_UPDATE Product;code[unique=true];categories(code, $catalogVersion)[mode=append]
;product1;category1
INSERT_UPDATE Product;code[unique=true];categories(code, $catalogVersion)[mode=append]
;product1;category2
or you can do this
INSERT_UPDATE Product;code[unique=true];categories(code, $catalogVersion)[mode=append]
;product1;category1
INSERT_UPDATE Product;code[unique=true];categories(code, $catalogVersion)[mode=replace]
;product1;category1, category2
hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.