This discussion is archived
1 Reply Latest reply: Feb 2, 2013 5:08 PM by VijayNimmakuri RSS

After clicking 'Finish' on configurator UI. Its not going back 2 SalesOrder

VijayNimmakuri Newbie
Currently Being Moderated
Hi,

I have an extension on 'PostConfigSave' event, which grabs the entire selected options and it posts back to user_item_description field on the sales order. Iam calling Process order API to update the oe_order_lines_all table.

When i make the entire selections and hit the finish button. The configurator page is still lying there its not going to sales order screen. any valuable inputs around this please.

I am using below code.

     conn = irn.getConfiguration().getContext().getJDBCConnection();
               
               PreparedStatement pStmt = null;
               ResultSet rs;
               
               String sql = "SELECT OOL.HEADER_ID,OOL.LINE_ID,OOL.ORG_ID FROM APPS.OE_ORDER_HEADERS_ALL OOH, APPS.OE_ORDER_LINES_ALL OOL WHERE OOH.HEADER_ID=OOL.HEADER_ID AND OOL.LINE_ID="+mOrderLineId;//17010
               try
               {
                    pStmt = conn.prepareStatement(sql);
                    rs = pStmt.executeQuery();
                    int line_id = 0;
                    int header_id=0;
                    int orgid=0;
                    
                    if (rs.next())
                    header_id = rs.getInt(1);
                    line_id = rs.getInt(2);
                    orgid = rs.getInt(3);
                    rs.close();
                    pStmt.close();
               
               
               
          cStmt = conn.prepareCall("{call XXCZ.XXO2C_CZ_COPTION.UPDATE_SO(?,?,?,?)}");
          
          //passing parameters header_id,line_id and ModelOption string
          cStmt.setInt(1, header_id);
          cStmt.setInt(2, line_id);
          cStmt.setString(3, derivedUid);
          cStmt.setInt(4, orgid);
          
          int ret = cStmt.executeUpdate();
     
          displayMessage("Sucessfull update User_item_description on Sales Order line" + ret, irn);
          
          ConfigTransaction tr = config.beginConfigTransaction();
          config.commitConfigTransaction(tr);
          
               }
          catch (SQLException e1) {
                    displayMessage("Exception while calling DB for sales order details"+e1.getMessage(), irn);
                    e1.printStackTrace();
               }                    
          } catch (Exception e2) {
               displayMessage("Exception while calling Process order API - "+e2.getMessage(), irn);
               e2.printStackTrace();
          }
          finally {
               try {
                    if(cStmt != null)
                         cStmt.close();
                    if(conn != null)
                         conn.close();
               } catch (SQLException e) {
                    displayMessage("Exception in uiGetSelectedModelOptions Method"+e.getMessage(), irn);
                    e.printStackTrace();
               }
          }
Thanks,
vijay

Edited by: Vijay Nimmakuri on Jan 31, 2013 11:58 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points