Use info methods instead of vars in callout.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Tue, 23 Mar 2010 17:36:39 +0100
changeset 6870 5957f8e78ad1
parent 6869 1bd2949f2f10
child 6871 be80945ca684
Use info methods instead of vars in callout.
src/org/openbravo/erpCommon/ad_callouts/SL_AdvPayment_Document.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_AdvPayment_Document.java	Tue Mar 23 11:38:34 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_AdvPayment_Document.java	Tue Mar 23 17:36:39 2010 +0100
@@ -2,6 +2,8 @@
 
 import javax.servlet.ServletException;
 
+import org.openbravo.base.filter.IsIDFilter;
+import org.openbravo.base.filter.RegexFilter;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.erpCommon.utility.Utility;
 
@@ -13,8 +15,9 @@
   protected void execute(CalloutInfo info) throws ServletException {
     VariablesSecureApp vars = info.vars;
     String strWindowNo = info.getWindowId();
-    String strTableNameId = vars.getStringParameter("inpkeyColumnId");
-    String strDocType_Id = vars.getStringParameter("inpcDoctypeId");
+    String strTableNameId = info.getStringParameter("inpkeyColumnId", new RegexFilter(
+        "[a-zA-Z0-9]*_[a-zA-Z0-9]*_ID"));
+    String strDocType_Id = info.getStringParameter("inpcDoctypeId", IsIDFilter.instance);
     String strTableName = strTableNameId.substring(0, strTableNameId.length() - 3);
     String strDocumentNo = Utility.getDocumentNo(this, vars, strWindowNo, strTableName,
         strDocType_Id, strDocType_Id, false, false);