Posts

Showing posts from October, 2020

Hybris/ SAP commerce Cloud Flexi search query

  Hybris flexi Search Query Sample: 1. Find Duplicate Product: select  {code},count({code}) from {product} group by {code} having count({code}) > 1  2. B2BUnit/Group belongs to User select distinct {unit.uid},{unit.name},{ct.uid} from { PrincipalGroupRelation as pgrel join b2bunit as unit on {unit.pk}={pgrel.target} Join B2Bcustomer as ct ON {ct.pk}={pgrel.source} } where {pgrel.source} in ({{ select {pk} from {b2bcustomer} where {uid}='example@gmail.com' }}) 3.User Belongs to B2Bunit select distinct {bcustomer.uid} from { B2BCustomer as bcustomer} where {bcustomer.pk} IN ({{ select distinct {ppgrprel.source} from {b2bunit as unit JOIN PrincipalGroupRelation as ppgrprel ON {unit:PK}= {ppgrprel:target} } where {unit.uid}='123456859_PARENT' }}) 4.User Belongs to Group select distinct top 10 {bcustomer.uid} from { B2BCustomer as bcustomer} where {bcustomer.pk} IN ({{ select distinct {ppgrprel.source} from {Usergroup as grp JOIN PrincipalGroupRelation as ppgrprel ...

How coronavirus is good and bad - By kavya and Kashvi

                                   HOW CORONAVIRUS IS GOOD AND BAD                           Do you like coronavirus? Well today I will be listing all the good and bad things about coronavirus. There is NO going to the pool, beach, and can't touch anybody either. BUT there are good things about it too, you do not need to wake up early to go to school, and when it's lunch time your food will not be cold it will be nice and hot, plus school ends early when your not at school then when you are at school. because you don't have to pack up then go to school bus and go home, WHEN YOUR ALREADY AT HOME!!                               

Find Duplicate CMSItem in Hybris/SAP Commerce Cloud.

  Find Duplicate CMSItem in Hybris/SAP Commerce Cloud. Example Error: 20.10.29 15:04:36:209 ERROR Cannot use source catalog version IndiaContentCatalog/Online( 8796093743705 ) for synchronization since it owns 1 duplicate CMSItem IDs 20.10.29 15:04:37:871 ERROR Aborted due to ver sion validation error SELECT {UID}, count(1) from {CMSItem} WHERE {CatalogVersion} = <CVPK> GROUP BY {UID} HAVING COUNT(1) > 1 Example Flexi Query: replace placeholder <CVPK> with PK from error you are getting highlighted in RED. Final Query: SELECT {UID}, count(1) from {CMSItem} WHERE {CatalogVersion} = 8796093743705 GROUP BY {UID} HAVING COUNT(1) > 1

Hybris / SAP Commerce Cloud Groovy Scripting Job to Generate CSV/Excel Reports and copy to Commerce cloud Blob Storage

Below are the steps to create scripting Cronjob from Back office: 1. Create Script of type Groovy 2. Create Scripting Job. 3. Create Cronjob. refer some already exist or OOB scripting job e.g.  evalCustomRefundAmount, evalOrigRefundAmount to get more details  Example Groovy Script: import de.hybris.platform.servicelayer.search.FlexibleSearchQuery; import java.text.SimpleDateFormat; flexibleSearchService = spring.getBean 'flexibleSearchService'; //put here the spring  bean specific to your project/implementation which reference to blob storage dataContainer =  spring.getBean 'dataContainer'; def fileContent = new StringBuilder(); //File header def FILE_HEADER = 'InvoiceNum,ActNum,Status'; def NEW_LINE_SEPARATOR = '\n'; def COMMA_DELIMITER = ','; fileContent.append(FILE_HEADER); fileContent.append(NEW_LINE_SEPARATOR); //File Name format and location in Azure Blob Storage def date = new Date(); def sdf = new SimpleDateFormat('MM_dd_yyyy_HH:mm...