diff --git a/org.adempiere.base/src/org/compiere/util/DB.java b/org.adempiere.base/src/org/compiere/util/DB.java index 1dd97303d1..e89edda524 100644 --- a/org.adempiere.base/src/org/compiere/util/DB.java +++ b/org.adempiere.base/src/org/compiere/util/DB.java @@ -1792,7 +1792,17 @@ public final class DB public static int getNextID (int AD_Client_ID, String TableName, String trxName) { boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false); - boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + // Check AdempiereSys + boolean adempiereSys = false; + if (Ini.isClient()) + { + adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + } + else + { + String sysProperty = Env.getCtx().getProperty("AdempiereSys", "N"); + adempiereSys = "y".equalsIgnoreCase(sysProperty) || "true".equalsIgnoreCase(sysProperty); + } if(SYSTEM_NATIVE_SEQUENCE && !adempiereSys) {