public static String createRequest(HttpServletRequest request,Properties ctx){
  String l_szTrxName=null;
  String l_szReturn=null;
  boolean l_bSuccess=true;
  BigDecimal l_bdAmt=getParameterAsBD(request,"RequestAmt");
  int l_nOrgID=getParameterAsInt(request,"AD_Org_ID");
  int l_nRoleID=getParameterAsInt(request,"AD_Role_ID");
  int l_nRReqTypeID=getParameterAsInt(request,"R_RequestType_ID");
  int l_nRGroupID=getParameterAsInt(request,"R_Group_ID");
  int l_nRCategoryID=getParameterAsInt(request,"R_Category_ID");
  int l_nRReqRelID=getParameterAsInt(request,"R_RequestRelated_ID");
  int l_nRStatusID=getParameterAsInt(request,"R_Status_ID");
  int l_nRResolID=getParameterAsInt(request,"R_Resolution_ID");
  int l_nBPartnerID=getParameterAsInt(request,"C_BPartner_ID");
  int l_nUserID=getParameterAsInt(request,"AD_User_ID");
  int l_nProjectID=getParameterAsInt(request,"C_Project_ID");
  int l_nAssetID=getParameterAsInt(request,"A_Asset_ID");
  int l_nOrderID=getParameterAsInt(request,"C_Order_ID");
  int l_nInvoiceID=getParameterAsInt(request,"C_Invoice_ID");
  int l_nProductID=getParameterAsInt(request,"M_Product_ID");
  int l_nPaymentID=getParameterAsInt(request,"C_Payment_ID");
  int l_nInOutID=getParameterAsInt(request,"M_InOut_ID");
  int l_nRMAID=getParameterAsInt(request,"M_RMA_ID");
  int l_nCampaignID=getParameterAsInt(request,"C_Campaign_ID");
  MRequest newRequest=new MRequest(ctx,0,l_szTrxName);
  newRequest.setAD_Org_ID(l_nOrgID);
  newRequest.setDueType(getParameterAsString(request,"DueType"));
  newRequest.setR_RequestType_ID(l_nRReqTypeID);
  newRequest.setR_Group_ID(l_nRGroupID);
  newRequest.setR_Category_ID(l_nRCategoryID);
  newRequest.setR_RequestRelated_ID(l_nRReqRelID);
  newRequest.setR_Status_ID(l_nRStatusID);
  newRequest.setR_Resolution_ID(l_nRResolID);
  newRequest.setPriority(getParameterAsString(request,"Priority"));
  newRequest.setPriorityUser(getParameterAsString(request,"PriorityUser"));
  newRequest.setSummary(getParameterAsString(request,"Summary"));
  newRequest.setConfidentialType(getParameterAsString(request,"ConfidentialType"));
  newRequest.setIsInvoiced(getParameterAsBool(request,"IsInvoiced"));
  newRequest.setConfidentialTypeEntry(getParameterAsString(request,"ConfidentialTypeEntry"));
  newRequest.setAD_Role_ID(l_nRoleID);
  newRequest.setC_BPartner_ID(l_nBPartnerID);
  newRequest.setAD_User_ID(l_nUserID);
  newRequest.setC_Project_ID(l_nProjectID);
  newRequest.setA_Asset_ID(l_nAssetID);
  newRequest.setC_Order_ID(l_nOrderID);
  newRequest.setC_Invoice_ID(l_nInvoiceID);
  newRequest.setM_Product_ID(l_nProductID);
  newRequest.setC_Payment_ID(l_nPaymentID);
  newRequest.setM_InOut_ID(l_nInOutID);
  newRequest.setM_RMA_ID(l_nRMAID);
  newRequest.setRequestAmt(l_bdAmt);
  newRequest.setC_Campaign_ID(l_nCampaignID);
  l_bSuccess&=newRequest.save();
  if (l_bSuccess) {
    try {
      DB.commit(true,l_szTrxName);
      l_szReturn="" + newRequest.get_ID();
    }
 catch (    Exception e) {
      l_szReturn=e.getMessage();
    }
  }
  return l_szReturn;
}

public static String createRequest ( HttpServletRequest request , Properties ctx ) { String l_szTrxName = null ; String l_szReturn = null ; boolean l_bSuccess = true ; BigDecimal l_bdAmt = getParameterAsBD ( request , "RequestAmt" ) ; int l_nOrgID = getParameterAsInt ( request , "AD_Org_ID" ) ; int l_nRoleID = getParameterAsInt ( request , "AD_Role_ID" ) ; int l_nRReqTypeID = getParameterAsInt ( request , "R_RequestType_ID" ) ; int l_nRGroupID = getParameterAsInt ( request , "R_Group_ID" ) ; int l_nRCategoryID = getParameterAsInt ( request , "R_Category_ID" ) ; int l_nRReqRelID = getParameterAsInt ( request , "R_RequestRelated_ID" ) ; int l_nRStatusID = getParameterAsInt ( request , "R_Status_ID" ) ; int l_nRResolID = getParameterAsInt ( request , "R_Resolution_ID" ) ; int l_nBPartnerID = getParameterAsInt ( request , "C_BPartner_ID" ) ; int l_nUserID = getParameterAsInt ( request , "AD_User_ID" ) ; int l_nProjectID = getParameterAsInt ( request , "C_Project_ID" ) ; int l_nAssetID = getParameterAsInt ( request , "A_Asset_ID" ) ; int l_nOrderID = getParameterAsInt ( request , "C_Order_ID" ) ; int l_nInvoiceID = getParameterAsInt ( request , "C_Invoice_ID" ) ; int l_nProductID = getParameterAsInt ( request , "M_Product_ID" ) ; int l_nPaymentID = getParameterAsInt ( request , "C_Payment_ID" ) ; int l_nInOutID = getParameterAsInt ( request , "M_InOut_ID" ) ; int l_nRMAID = getParameterAsInt ( request , "M_RMA_ID" ) ; int l_nCampaignID = getParameterAsInt ( request , "C_Campaign_ID" ) ; MRequest newRequest = new MRequest ( ctx , 0 , l_szTrxName ) ; newRequest . setAD_Org_ID ( l_nOrgID ) ; newRequest . setDueType ( getParameterAsString ( request , "DueType" ) ) ; newRequest . setR_RequestType_ID ( l_nRReqTypeID ) ; newRequest . setR_Group_ID ( l_nRGroupID ) ; newRequest . setR_Category_ID ( l_nRCategoryID ) ; newRequest . setR_RequestRelated_ID ( l_nRReqRelID ) ; newRequest . setR_Status_ID ( l_nRStatusID ) ; newRequest . setR_Resolution_ID ( l_nRResolID ) ; newRequest . setPriority ( getParameterAsString ( request , "Priority" ) ) ; newRequest . setPriorityUser ( getParameterAsString ( request , "PriorityUser" ) ) ; newRequest . setSummary ( getParameterAsString ( request , "Summary" ) ) ; newRequest . setConfidentialType ( getParameterAsString ( request , "ConfidentialType" ) ) ; newRequest . setIsInvoiced ( getParameterAsBool ( request , "IsInvoiced" ) ) ; newRequest . setConfidentialTypeEntry ( getParameterAsString ( request , "ConfidentialTypeEntry" ) ) ; newRequest . setAD_Role_ID ( l_nRoleID ) ; newRequest . setC_BPartner_ID ( l_nBPartnerID ) ; newRequest . setAD_User_ID ( l_nUserID ) ; newRequest . setC_Project_ID ( l_nProjectID ) ; newRequest . setA_Asset_ID ( l_nAssetID ) ; newRequest . setC_Order_ID ( l_nOrderID ) ; newRequest . setC_Invoice_ID ( l_nInvoiceID ) ; newRequest . setM_Product_ID ( l_nProductID ) ; newRequest . setC_Payment_ID ( l_nPaymentID ) ; newRequest . setM_InOut_ID ( l_nInOutID ) ; newRequest . setM_RMA_ID ( l_nRMAID ) ; newRequest . setRequestAmt ( l_bdAmt ) ; newRequest . setC_Campaign_ID ( l_nCampaignID ) ; l_bSuccess &= newRequest . save ( ) ; if ( l_bSuccess ) { try { DB . commit ( true , l_szTrxName ) ; l_szReturn = "" + newRequest . get_ID ( ) ; } catch ( Exception e ) { l_szReturn = e . getMessage ( ) ; } } return l_szReturn ; }
creates a new request .
