2 Replies Latest reply on Aug 29, 2013 6:28 PM by MAHA REDDY

    How to pass multiple parameters to vo

    MAHA REDDY

      Hi,

       

      I wrote   Serializable method  In co

             String orgcode1 = pageContext.getTransactionTransientValue("asset12").toString();

             String assetid = pageContext.getTransactionTransientValue("asset1").toString();

              Serializable[] np1={orgcode1,assetid};

              am.invokeMethod("xxEx1",np1);

       

      I wrote in AMImpl

       

          public void xxEx1(String na2,String na3)

          {

              internalcpVOImpl vo =getinternalcpVO1();

              String wc1="organization_code='"+na2+"'";

              String wc="SEGMENT1='"+na3+"'";

              vo.setWhereClause(null);

              vo.setWhereClause(wc1);

              vo.setWhereClause(wc);

              vo.executeQuery();

         }

       

      I need add that where classes in this vo

       

      SELECT  distinct  meav.c_attribute1, msi.segment1 ,mp.organization_code

               FROM csi_item_instances cii,

             mtl_system_items_b msi,

             mtl_eam_asset_attr_values meav,

             mtl_parameters mp

      WHERE  meav.SERIAL_NUMBER  = cii.SERIAL_NUMBER

         And meav.MAINTENANCE_OBJECT_ID = cii.INSTANCE_ID

         And meav.ORGANIZATION_ID = cii.LAST_VLD_ORGANIZATION_ID

         And meav.attribute_category     = 'Asset Common Details'

         And msi.inventory_item_id = cii.inventory_item_id

         And meav.organization_id = mp.organization_id

            -------------------------------  1  ( nedd add  vo.setWhereClause(wc1);)

          ------------------------------------2  (        vo.setWhereClause(wc);)

       

      It is only adding first parameter  where class it's not adding second parameter where class please give me any solution

       

      Regards,

      Maha

        • 1. Re: How to pass multiple parameters to vo
          Shddn

          Hi Maha

           

          I hope you want to pass

          organization_code=na2

                  and SEGMENT1=na3;

           

          use following

           

          String whereClause="organization_code='"+na2+"' AND SEGMENT1='"+na3+"'";

            vo.setWhereClause(null);

                  vo.setWhereClause(whereClause);

                  vo.executeQuery();

           

          Regards

           

          Shobhit S

          • 2. Re: How to pass multiple parameters to vo
            MAHA REDDY

            Thank You Shobhit basis on you are code it's working  future reference purpose i posted code .

             

            I wrote   Serializable method  In co

                   String orgcode1 = pageContext.getTransactionTransientValue("asset12").toString();

                   String assetid = pageContext.getTransactionTransientValue("asset1").toString();

                    Serializable[] np1={orgcode1,assetid};

                    am.invokeMethod("xxEx1",np1);

             

            In am i am using below code

                public void xxEx1(String na2,String na3)

                {

                   internalcpVOImpl vo =getinternalcpVO1();

                 String whereClause="organization_code='"+na2+"' AND SEGMENT1='"+na3+"'";

                           vo.setWhereClause(null);

                           vo.setWhereClause(whereClause);

                           vo.executeQuery();

               }    

             

            In vo i wrote this code

            SELECT  distinct  meav.c_attribute1, msi.segment1 ,mp.organization_code

                     FROM csi_item_instances cii,

                   mtl_system_items_b msi,

                   mtl_eam_asset_attr_values meav,

                   mtl_parameters mp

            WHERE  meav.SERIAL_NUMBER  = cii.SERIAL_NUMBER

               And meav.MAINTENANCE_OBJECT_ID = cii.INSTANCE_ID

               And meav.ORGANIZATION_ID = cii.LAST_VLD_ORGANIZATION_ID

               And meav.attribute_category     = 'Asset Common Details'

               And msi.inventory_item_id = cii.inventory_item_id

               And meav.organization_id = mp.organization_id

             

            Regards,

            Maha