/// <summary>
        /// Create field on table
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="fieldName"></param>
        /// <param name="fieldDescription"></param>
        /// <param name="type"></param>
        /// <param name="size"></param>
        /// <param name="subType"></param>
        /// <param name="validValues">Dropdown values</param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static void CreateField(string tableName, string fieldName, string fieldDescription,
                                       BoFieldTypes type = BoFieldTypes.db_Alpha, int size = 50, BoFldSubTypes subType = BoFldSubTypes.st_None,
                                       IDictionary <string, string> validValues = null, string defaultValue = null)
        {
            UserFieldsMD userFieldsMd = null;

            try
            {
                userFieldsMd = SboApp.Company.GetBusinessObject(BoObjectTypes.oUserFields) as UserFieldsMD;

                if (userFieldsMd == null)
                {
                    throw new NullReferenceException("Failed to get UserFieldsMD object");
                }

                var fieldId = GetFieldId(tableName, fieldName);
                if (fieldId != -1)
                {
                    return;
                }

                userFieldsMd.TableName    = tableName;
                userFieldsMd.Name         = fieldName;
                userFieldsMd.Description  = fieldDescription;
                userFieldsMd.Type         = type;
                userFieldsMd.SubType      = subType;
                userFieldsMd.Size         = size;
                userFieldsMd.EditSize     = size;
                userFieldsMd.DefaultValue = defaultValue;

                if (validValues != null)
                {
                    foreach (var validValue in validValues)
                    {
                        userFieldsMd.ValidValues.Value       = validValue.Key;
                        userFieldsMd.ValidValues.Description = validValue.Value;
                        userFieldsMd.ValidValues.Add();
                    }
                }

                ErrorHelper.HandleErrorWithException(userFieldsMd.Add(), "Could not create field");
            }
            catch (Exception ex)
            {
                SboApp.Logger.Error($"Create Field {tableName}.{fieldName} Error: {ex.Message}", ex);
                throw;
            }
            finally
            {
                if (userFieldsMd != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(userFieldsMd);
                }
            }
        }
        /// <summary>
        /// Create UDT (tableName of UserTables will allways become UPPERCASE in HANA)
        /// </summary>
        /// <param name="tableName">Table name eg: NS_MyTable (in UPPERCASE is recommended)</param>
        /// <param name="tableDescription"></param>
        /// <param name="tableType"></param>
        /// <returns>Success</returns>
        public static UserDefinedTable CreateTable(string tableName, string tableDescription, BoUTBTableType tableType = BoUTBTableType.bott_NoObject)
        {
            UserTablesMD userTablesMd = null;

            try
            {
                userTablesMd = SboApp.Company.GetBusinessObject(BoObjectTypes.oUserTables) as UserTablesMD;

                if (userTablesMd == null)
                {
                    throw new NullReferenceException("Failed to get UserTablesMD object");
                }

                if (!userTablesMd.GetByKey(tableName))
                {
                    userTablesMd.TableName        = tableName;
                    userTablesMd.TableDescription = tableDescription;
                    userTablesMd.TableType        = tableType;
                    ErrorHelper.HandleErrorWithException(
                        userTablesMd.Add(),
                        $"Could not create UDT {tableName}");
                }
            }
            catch (Exception ex)
            {
                SboApp.Logger.Error($"UDT Create Error: {ex.Message}", ex);
                throw;
            }
            finally
            {
                if (userTablesMd != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(userTablesMd);
                }
                userTablesMd = null;
                GC.Collect();
            }

            return(new UserDefinedTable("@" + tableName));
        }