IDEMPIERE-3735 Import Business Partner gives a 'Null Pointer Exception' / IDEMPIERE-3512

This commit is contained in:
Carlos Ruiz 2018-07-09 20:26:15 +02:00
parent 7f2ae83d53
commit ada02cdea5
1 changed files with 2 additions and 0 deletions

View File

@ -1485,6 +1485,7 @@ public class GridTabCSVImporter implements IGridTabImporter
StringBuilder postSelect = new StringBuilder(" FROM ")
.append(foreignTable).append(" WHERE ")
.append(foreignColumn).append("=? AND IsActive='Y' AND AD_Client_ID=?");
if (field != null ) {
if (!Util.isEmpty(field.getVO().ValidationCode)) {
String dynamicValid = Env.parseContext(Env.getCtx(), field.getWindowNo(), field.getGridTab().getTabNo(), field.getVO().ValidationCode, false);
if (Util.isEmpty(dynamicValid)) {
@ -1509,6 +1510,7 @@ public class GridTabCSVImporter implements IGridTabImporter
}
}
}
}
StringBuilder selectCount = new StringBuilder("SELECT COUNT(*)").append(postSelect);
StringBuilder selectId = new StringBuilder("SELECT ").append(foreignTable).append("_ID").append(postSelect);
int count = DB.getSQLValueEx(trxName, selectCount.toString(), value, thisClientId);