////public static bool GetCodeGeneration(string TableName)
////{
//// try
//// {
//// SAPbobsCOM.Recordset rsetCode =Variables.sCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
//// string strCode = "Select ISNULL(Max(ISNULL(DocEntry,0)),0) + 1 Code From " + TableName.ToString().Trim() + "";
//// rsetCode.DoQuery(strCode);
//// return Convert.ToInt16( (rsetCode.Fields.Item("Code").Value));
//// }
//// catch (Exception ex)
//// {
//// EventHandler.oApplication.StatusBar.SetText("GetCodeGeneration Function Failed:" + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
//// return false;
//// }
//// finally
//// {
//// }
//// return true;
////}