0 Replies Latest reply: Nov 1, 2010 8:45 PM by pekochan RSS

    Error after changing Session.class (Invalid ORDER TYPE ID)

    pekochan
      Hi,

      I am new to iStore and I have been asked to modify Session.class under $JAVA_TOP/oracle/apps/ibe/util. I know, quite risky to change a standard class. But it was needed so Oracle provided the following solution:
      String ou = getRespProfile(RequestCtx.getResponsibilityId(), "ORG_ID");
      if (ou == null or "".equals(ou))
      {
      ou = IBEUtil.getStoreSiteProfile("ORG_ID");
      }
      ..seeded code..
      BTW, the goal was to derive the ORG_ID based from the Responsibility Id instead of the usual ORG_ID Profile. This is because some customers (who will be using iStore) are registered under a different org_id but can create orders from another Org_id.

      And so, i have followed oracle's instruction in changing the way org_id is derived. See as follows:
      private static void setOperatingUnit()
      {
      String s = "setOperatingUnit";
      boolean flag = IBEUtil.logEnabled();
      String s1 = IBEUtil.getProfile("ORG_ID");
      /*if(flag)
      {
      IBEUtil.log("Session", s, "set ou (" + s1 + ")");
      }
      if(s1 != null)
      {
      RequestCtx.setCookieValue("zo", s1);
      return;
      } else
      {
      RequestCtx.setCookieValue("zo", "-1");
      return;
      }*/

      String sRespId = String.valueOf(RequestCtx.getResponsibilityId());
      if ("null".equals(sRespId) || "Null".equals(sRespId) || "NULL".equals(sRespId))
      {
           sRespId = "";
      }
      String ou = IBEUtil.getRespProfile(sRespId, "ORG_ID");
      if(flag)
      {
      IBEUtil.log("Session", s, "set ou (" + ou + ")");
      }
      if (ou == null || "".equals(ou))
      {
      ou = IBEUtil.getStoreSiteProfile("ORG_ID");
      }               
      if (ou != null)
      {
      RequestCtx.setCookieValue("zo", ou);
      return;
      }
      else
      {
      RequestCtx.setCookieValue("zo", "-1");
      return;
      }
      }
      Under $JAVA_TOP/oracle/apps/ibe/util, I was able to compile this with no problems. Before, that user under 100 org_id can't see items listed under 101 org_id. Now it's user under 100 org_id can see items under 101 org_id after my change.

      However, once in a while, I am getting the following error:

      The column(s), ORDER_TYPE_ID, has an invalid value(s).

      But if I go to another page then back to the cart's page, I can see the items (with 101 org_id) displayed.

      Any idea why?? How can i solve this issue??

      Thanks for your assistance, in advance.

      N