<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: extended product type not accessible in CRM and CX Q&amp;A</title>
    <link>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061246#M405865</link>
    <description>&lt;P&gt;Please change your query as follows and try again:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; final String query = "SELECT {p:" + FoodItemModel.PK + "} FROM {" + FoodItemModel._TYPECODE + " AS p} ";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT on 21-May-2019:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you are getting the result in hAC but not through the code, please add the following code before calling flexibleSearchService.search and try again:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; sessionService.setAttribute(SessionContext.USER, userService.getUser(Constants.USER.ADMIN_EMPLOYEE));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 19 May 2019 16:39:51 GMT</pubDate>
    <dc:creator>arvind-kumar_avinash</dc:creator>
    <dc:date>2019-05-19T16:39:51Z</dc:date>
    <item>
      <title>extended product type not accessible</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaq-p/12061245</link>
      <description>&lt;P&gt;i have created a new itemtype fooditem extending product type as below:    &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; &amp;lt;itemtype code="FoodItem" extends="Product"&amp;gt;
             &amp;lt;description&amp;gt;food items&amp;lt;/description&amp;gt;
             &amp;lt;attributes&amp;gt;
                 &amp;lt;attribute type="java.lang.Integer" qualifier="price"&amp;gt;
                     &amp;lt;persistence type="property"&amp;gt;&amp;lt;/persistence&amp;gt;
                 &amp;lt;/attribute&amp;gt;
             &amp;lt;/attributes&amp;gt;
         &amp;lt;/itemtype&amp;gt;  

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;i successfully added 20 rows using impex as follows:  &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; insert_update FOODITEM  PRICE ; NAME; CODE[unique=true] ; CATALOGVERSION(catalog(id),version)[unique=true] ;  

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but when i am trying to access the rows in DAO layer, the flexibleSearchService is returning 0 rows.&lt;BR /&gt;The DAO layer code snippet is like below:  &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; public List&amp;lt;FoodItemModel&amp;gt; getAllFood()
     {
         // XXX Auto-generated method stub
 
         //        catalogVersionService.setSessionCatalogVersion("FoodInSystems", "Online");
         final String query = "select {pk} from {fooditem}";
         final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query);
         final List&amp;lt;FoodItemModel&amp;gt; items = flexibleSearchService.&amp;lt;FoodItemModel&amp;gt; search(fQuery).getResult();
         LOG.info(fQuery.toString());
         LOG.info("In " + DefaultFoodItemDAO.class.toString() + " , we found " + Integer.toString(items.size()) + " food items");
         LOG.info(Integer.toString(catalogVersionService.getSessionCatalogVersions().size()));
 
         LOG.info(catalogVersionService.getSessionCatalogVersions().toString());
 
         return items;
     }  

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the output looks like below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; INFO  [hybrisHTTP29] [DefaultFoodItemDAO] query: [select {pk} from {fooditem}], query parameters: [{}]
 INFO  [hybrisHTTP29] [DefaultFoodItemDAO] In class com.infy.daos.impl.DefaultFoodItemDAO , we found 0 food items
 INFO  [hybrisHTTP29] [DefaultFoodItemDAO] 1
 INFO  [hybrisHTTP29] [DefaultFoodItemDAO] [CatalogVersionModel (8796093121113@1)]  


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 May 2019 16:03:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaq-p/12061245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-19T16:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: extended product type not accessible</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061246#M405865</link>
      <description>&lt;P&gt;Please change your query as follows and try again:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; final String query = "SELECT {p:" + FoodItemModel.PK + "} FROM {" + FoodItemModel._TYPECODE + " AS p} ";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT on 21-May-2019:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you are getting the result in hAC but not through the code, please add the following code before calling flexibleSearchService.search and try again:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; sessionService.setAttribute(SessionContext.USER, userService.getUser(Constants.USER.ADMIN_EMPLOYEE));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 May 2019 16:39:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061246#M405865</guid>
      <dc:creator>arvind-kumar_avinash</dc:creator>
      <dc:date>2019-05-19T16:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: extended product type not accessible</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061247#M405866</link>
      <description>&lt;P&gt;hello  , it is still not working.
I am doing this in yempty extension template, does that matter?
&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 05:52:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061247#M405866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-20T05:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: extended product type not accessible</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061248#M405867</link>
      <description>&lt;P&gt;Hi Rajat,&lt;/P&gt;
&lt;P&gt;Did you check , whether you have products with the catalog version : [CatalogVersionModel (8796093121113@1)]  or not ?
&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:44:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061248#M405867</guid>
      <dc:creator>bidyadhar_tripathy</dc:creator>
      <dc:date>2019-05-21T10:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: extended product type not accessible</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061249#M405868</link>
      <description>&lt;P&gt;Hello Rajat,&lt;/P&gt;
&lt;P&gt;It might be the case that you have imported the FoodItems in Staged version and they have not been synchronized to Online version. Could you please check that as well.&lt;/P&gt;
&lt;P&gt;Thanks,
Subhash.
&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 11:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061249#M405868</guid>
      <dc:creator>sduvvuri</dc:creator>
      <dc:date>2019-05-21T11:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: extended product type not accessible</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061250#M405869</link>
      <description>&lt;P&gt;Hi  ,&lt;/P&gt;
&lt;P&gt;Have you checked in ".../hac/console/flexsearch" what do you have in the database. Also, you can easily check catalogversion on items....&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; SELECT {fi.pk},{c.id},{cv.version} FROM {FoodItem AS fi JOIN Catalog AS c ON {fi.catalog}={c.pk} JOIN CatalogVersion AS cv ON {fi.catalogversion}={cv.pk}}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 17:45:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/extended-product-type-not-accessible/qaa-p/12061250#M405869</guid>
      <dc:creator>dario_petrovic</dc:creator>
      <dc:date>2019-05-21T17:45:37Z</dc:date>
    </item>
  </channel>
</rss>

