0 Replies Latest reply: Sep 9, 2013 6:03 AM by user11040901 RSS

    Vo empty after throw new OAException

    user11040901

      Hi,

       

      I've extend CO to add a new validation in the submit button.

       

      if (oapagecontext.getParameter("SubmitButton")!= null)

      {

      OAViewObject povo = (OAViewObject)rootAM.findViewObject("PoLinesMergeVO");

                    if (povo == null)

                    {

                        oapagecontext.writeDiagnostics(this,"PoLinesMergeVO not found",1);

                        MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "PoLinesMergeVO")};

                        throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND",tokens);

                    }

                    oracle.jbo.Row rowl = povo.first();

                    OARow row = null;

                   

                    RowSetIterator itrl = null;

                   

                    if (povo != null && vo.isExecuted())

                    {

                         if (povo.findRowSetIterator("Iterator") == null) {

                         itrl = povo.createRowSetIterator("Iterator");

                         } else {

                         itrl = povo.findRowSetIterator("Iterator");

                         }

                        

                         while (itrl.hasNext())

                         {

                            row = (OARow)itrl.next();

                           

                            s_comanda = String.valueOf(rowl.getAttribute("PoHeaderId"));

                            s_polineid =  String.valueOf(rowl.getAttribute("PoLineId"));

                            String s_tipo_linea =  String.valueOf(rowl.getAttribute("LineType"));

                            s_category =  String.valueOf(rowl.getAttribute("Category"));

                            int i_category = s_category.length();

                             

                            oapagecontext.writeDiagnostics(this,"Length  "+i_category,1); 

                            s_vendor_product =  String.valueOf(rowl.getAttribute("VendorProductNum"));

                    

                            if ((s_tipo_linea.equalsIgnoreCase("Fungibles")) && (i_category != 0))

                            {

                              oapagecontext.writeDiagnostics(this,"s_vendor_product "+s_vendor_product,1); 

                             

                              if (s_vendor_product.equalsIgnoreCase("null"))

                              {

                                  MessageToken[] tokens = {};

                                  throw new OAException("XX", "XX_ARTICULO_PROV",tokens);

                              }

                            }

       

       

                        }

                        itrl.closeRowSetIterator();

                    }

       

      }

       

      The first time that I click on the submit button I got the correct error throug OAException, however if I click again PoLinesMergeVO is empty.  Could you tell me why VO is empty if we have the values on the screen?

       

      Regards Mayte