0 Replies Latest reply: Oct 31, 2012 8:09 AM by 949915 RSS

    Siebel data bean returning wrong value for Employee's Organization field

    949915
      Hello,

      I am trying to fetch Employee records from Siebel using Java Data Bean Apis.
      I am using Siebel 8.2 server & data bean jars.

      I am trying to fetch an Employee's records in which I have few single value fields and few multi value fields.
      Issue here is with fetching Organization field for an employee.
      When I fetch this field using business comp method getMBVBusComp("Organization"), values which are returned are either of "Position" fields or multiple redundant values of an Organization.

      My code looks like below,

      m_busObject = m_dataBean.getBusObject("Employee");
           m_busComp = m_busObject.getBusComp("Employee");
           SiebelPropertySet oPsDR_Header= m_dataBean.newPropertySet();
           SiebelPropertySet lPS_values= m_dataBean.newPropertySet();
           
           oPsDR_Header= m_dataBean.newPropertySet();
           lPS_values= m_dataBean.newPropertySet();
           oPsDR_Header.setProperty("Login Name","");
           oPsDR_Header.setProperty("Organization","");


                m_busComp.clearToQuery();
                m_busComp.activateField("Login Name");
                m_busComp.setSearchSpec("Login Name","John");
                m_busComp.setViewMode(3);
                m_busComp.activateMultipleFields(oPsDR_Header);
                m_busComp.executeQuery(true);
                if(m_busComp.firstRecord()){
                
      do{
                     m_busComp.getMultipleFieldValues(oPsDR_Header, lPS_values);     
           System.out.println("Name" +lPS_values.getProperty("Name"));
                
                
                System.out.println("================" );
                System.out.println("EMPLOYEE Login Name: " + lPS_values.getProperty("Login Name"));
                System.out.println("================" );
                m_Pos = m_busComp.getMVGBusComp("Organization");
                m_Pos.firstRecord();
                System.out.println("==========" );
                System.out.println("Organization:" );
                System.out.println("==========" );
                do
                     {
                     //Get the value from the output property set.
                System.out.println(m_Pos.getFieldValue("Name"));
                } while (m_Pos.nextRecord());


      Here values which are printed are of Positions which are associated with this Employee & not Organizations.

      Can someone help me understand this behavior?

      Is there any thing that I am doing wrong?

      Thanks in advance!!

      -Harshal