StringBuffer resultado = new StringBuffer();
resultado.append("var calloutName='SE_Project_BPartner';\n\n");
resultado.append("var respuesta = new Array(");
FieldProvider[] tdv = null;
try {
ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "M_PriceList_ID",
"", "", Utility.getContext(this, vars, "#AccessibleOrgTree", strWindowId), Utility
.getContext(this, vars, "#User_Client", strWindowId), 0);
Utility.fillSQLParameters(this, vars, null, comboTableData, strWindowId, "");
tdv = comboTableData.select(false);
comboTableData = null;
} catch (Exception ex) {
throw new ServletException(ex);
}
try {
ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
"C_BPartner_Location_ID", "", "C_BPartner Location - Ship To", Utility.getContext(this,
vars, "#AccessibleOrgTree", strWindowId), Utility.getContext(this, vars,
"#User_Client", strWindowId), 0);
Utility.fillSQLParameters(this, vars, null, comboTableData, strWindowId, "");
tdv = comboTableData.select(false);
comboTableData = null;
} catch (Exception ex) {
throw new ServletException(ex);
}
resultado.append("new Array(\"inpcBpartnerLocationId\", ");
if (tdv != null && tdv.length > 0) {
resultado.append("new Array(");
for (int i = 0; i < tdv.length; i++) {
resultado.append("new Array(\"" + tdv[i].getField("id") + "\", \""
+ FormatUtilities.replaceJS(tdv[i].getField("name")) + "\", \""
+ (tdv[i].getField("id").equalsIgnoreCase(strLocation) ? "true" : "false") + "\")");
if (i < tdv.length - 1)
resultado.append(",\n");
}
resultado.append("\n)");
} else
resultado.append("null");
resultado.append("\n),");
try {
ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "AD_User_ID", "",
"AD_User C_BPartner User/Contacts", Utility.getContext(this, vars, "#AccessibleOrgTree",
strWindowId), Utility.getContext(this, vars, "#User_Client", strWindowId), 0);
Utility.fillSQLParameters(this, vars, null, comboTableData, strWindowId, "");
tdv = comboTableData.select(false);
comboTableData = null;
} catch (Exception ex) {
throw new ServletException(ex);
}
resultado.append("new Array(\"inpadUserId\", ");
if (tdv != null && tdv.length > 0) {
resultado.append("new Array(");
for (int i = 0; i < tdv.length; i++) {
resultado.append("new Array(\"" + tdv[i].getField("id") + "\", \""
+ FormatUtilities.replaceJS(tdv[i].getField("name")) + "\", \""
+ (tdv[i].getField("id").equalsIgnoreCase(strContact) ? "true" : "false") + "\")");
if (i < tdv.length - 1)
resultado.append(",\n");
}
resultado.append("\n)");
} else
resultado.append("null");
resultado.append("\n),");
FieldProvider[] tlv = null;
try {
ComboTableData comboTableData = new ComboTableData(vars, this, "TABLE", "",
"C_BPartner Location", "C_BPartner Location - Bill To", Utility.getContext(this, vars,
"#AccessibleOrgTree", strWindowId), Utility.getContext(this, vars, "#User_Client",
strWindowId), 0);
Utility.fillSQLParameters(this, vars, null, comboTableData, strWindowId, "");
tlv = comboTableData.select(false);
comboTableData = null;
} catch (Exception ex) {
throw new ServletException(ex);
}