Search Results for

    Show / Hide Table of Contents

    Interface ICustomObjectProperty

    The system entity for a Custom Object Property, which belongs to a ICustomObject

    See https://help.lemonedge.com/help/api/auto-code-designers/custom-entities/properties-view.html for more information

    Inherited Members
    IShareAcrossAccounts.IsShared
    IBaseEntity.GetLabel(string)
    IBaseEntity.SetLabel(string, string)
    IBaseEntity.SetSilentLabel(string, string)
    IBaseEntity.AccountID
    IBaseEntity.ID
    IBaseEntity.LastUpdated
    IBaseEntity.ModifiedByUserID
    IBaseEntity.CanvasID
    IBaseEntity.AlgorithmStepID
    IBaseEntity.SafeID
    IEquatable<IBaseEntity>.Equals(IBaseEntity)
    INotifyPropertyChanged.PropertyChanged
    INotifyPropertyChanging.PropertyChanging
    ICloneableAsync.Clone(object)
    ICloneableAsync.CopyFromSource(object)
    ICanTrackProperties.HasTrackedPropertyChanged(string)
    ICanTrackProperties.OriginalTrackedPropertyValue(string)
    ICanTrackProperties.OriginalTrackedPropertyValue<T>(string)
    ICanTrackProperties.ClearTrackedOriginalValues()
    ICanTrackProperties.GetAllOriginalTrackedPropertyValues()
    Namespace: LemonEdge.API.Entities.Design
    Assembly: LemonEdge.API.dll
    Syntax
    [EntityDefinition(EntityID.CustomObjectProperty, "dbo.LT_CustomObjectProperties", "CustomObjectProperty", LabelColumn = "PropertyName", IsStandingDataEntity = true)]
    [DefaultEntityIcon(ImageType.DataTableColumn)]
    [EntityIndex(Name = "CustomProps", ColumnNames = new string[] { "CustomObjectID" }, IndexOrder = new IndexOrder[] { IndexOrder.Ascending }, IsClustered = false, IsUnique = false)]
    public interface ICustomObjectProperty : IShareAcrossAccounts, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties

    Properties

    AutoIncStart

    A number that indicates this property is a Int64 (BigInt) column that auto-increments in value starting from this number

    Declaration
    [EntityProperty(SQLType.Int, true)]
    [EntityDescription("A number that indicates this property is a Int64 (BigInt) column that auto-increments in value starting from this number.")]
    int? AutoIncStart { get; set; }
    Property Value
    Type Description
    int?

    ColumnMaxLength

    If this column type requires a length, such as nvarchar, then you should specify one here. If none is specified the system assumes nvarchar(max).

    Declaration
    [EntityProperty(SQLType.SmallInt, true)]
    [EntityDescription("The maximum data length for varchar column types. Null indicates (max).")]
    short? ColumnMaxLength { get; set; }
    Property Value
    Type Description
    short?

    ColumnName

    [Key] A required field which is the unique (within this entity) name of this property. This is the actual name of the column which will be created in the database.

    Declaration
    [EntityProperty(SQLType.NVarChar, 500, false)]
    [EntityKeyProperty]
    [Unique(AllowNullOrEmpty = false, MergeWithAnyOtherUniqueProperties = true)]
    [EntityDescription("The name of this custom object column - the name that will be used in the database.")]
    [Required(AllowEmptyStrings = false)]
    [PropertyValidation("true", "!string.Equals(MyItem.ColumnName, \"AccountID\", StringComparison.CurrentCultureIgnoreCase)", "The AccountID name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.ColumnName, \"CanvasID\", StringComparison.CurrentCultureIgnoreCase)", "The CanvasID name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.ColumnName, \"ID\", StringComparison.CurrentCultureIgnoreCase)", "The ID name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.ColumnName, \"LastUpdated\", StringComparison.CurrentCultureIgnoreCase)", "The LastUpdated name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.ColumnName, \"ModifiedByUserID\", StringComparison.CurrentCultureIgnoreCase)", "The ModifiedByUserID name is a reserved word already used by the system, please use another.")]
    [FileSafeNameValidation]
    string ColumnName { get; set; }
    Property Value
    Type Description
    string

    ColumnPrecision

    If this field requires a precision and scale (such as decimal) then you can specify the precision component here

    Declaration
    [EntityProperty(SQLType.SmallInt, true)]
    [EntityDescription("The precision to be used for decimal sql types.")]
    short? ColumnPrecision { get; set; }
    Property Value
    Type Description
    short?

    ColumnScale

    If this field requires a precision and scale (such as decimal) then you can specify the scale component here

    Declaration
    [EntityProperty(SQLType.SmallInt, true)]
    [EntityDescription("The scale to be used for decimal sql types.")]
    short? ColumnScale { get; set; }
    Property Value
    Type Description
    short?

    ColumnType

    The sql type to store the data of this field in.

    Declaration
    [EntityProperty(SQLType.SmallInt, false)]
    [EntityDescription("The type of SQL column holding this property's data.")]
    [PropertyValidation("true", "MyItem.ColumnType != LemonEdge.Utils.Database.SQLType.TimeStamp", "Tables can only have one timestamp column and that is already used by the LastUpdated column.")]
    [PropertyValidation("true", "MyItem.ColumnType != LemonEdge.Utils.Database.SQLType.Date && MyItem.ColumnType != LemonEdge.Utils.Database.SQLType.DateTime && MyItem.ColumnType != LemonEdge.Utils.Database.SQLType.DateTime2 && MyItem.ColumnType != LemonEdge.Utils.Database.SQLType.SmallDateTime", "The web service only support DateTimeOffset type. You should use this for dates, and date time values instead.")]
    [PropertyValidation("MyItem.ColumnType == LemonEdge.Utils.Database.SQLType.Decimal", "MyItem.ColumnPrecision.HasValue", "A decimal type must have a ColumnPrecision value.")]
    [PropertyValidation("MyItem.ColumnType == LemonEdge.Utils.Database.SQLType.Decimal", "MyItem.ColumnScale.HasValue", "A decimal type must have a ColumnScale value.")]
    [PropertyValidation("true", "LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsPropertyTypeValid(MyItem)", "The PropertyType and ColumnType are not compatible.")]
    [HardCodedDefaultValueOnNew("0")]
    SQLType ColumnType { get; set; }
    Property Value
    Type Description
    SQLType

    CustomObjectID

    [Key] Links to ICustomObject. The parent custom object this entity belongs to

    Declaration
    [EntityProperty(SQLType.UniqueIdentifier, false)]
    [EntityRelationship(EntityID.CustomObject, "ID", SingleJoinType.One, "Custom Entitiy", "Properties", DeleteWithRelationship = true, PartOfParentSet = true, InheritPermissions = true)]
    [RequiredNoDefaultIDValidation]
    [EntityKeyProperty]
    [Unique(AllowNullOrEmpty = false, MergeWithAnyOtherUniqueProperties = true)]
    Guid CustomObjectID { get; set; }
    Property Value
    Type Description
    Guid

    DefaultSQLForNotNullable

    If you are adding a column, or altering one, that is not nullable this is the default sql to apply to populate it with a value.

    Declaration
    [EntityProperty(SQLType.NVarChar, 500, true)]
    [EntityDescription("If you are adding a column, or altering one, that is not nullable this is the default sql to apply to populate it with a value.")]
    [PropertyValidation("!string.IsNullOrEmpty(MyItem.DefaultSQLForNotNullable)", "!MyItem.DefaultSQLForNotNullable.ContainsWholeWord(\"go\", StringComparison.InvariantCultureIgnoreCase) && !MyItem.DefaultSQLForNotNullable.ContainsWholeWord(\"drop\", StringComparison.InvariantCultureIgnoreCase, new string[] { \"drop table #\" }) && !MyItem.DefaultSQLForNotNullable.ContainsWholeWord(\"create\", StringComparison.InvariantCultureIgnoreCase, new string[] { \"create table #\" }) && !MyItem.DefaultSQLForNotNullable.ContainsWholeWord(\"exec\", StringComparison.InvariantCultureIgnoreCase)", "Contains invalid sql.")]
    [PropertyValidation("!MyItem.IsNullable", "await LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsNullableValid(MyItem, Data)", "When changing a column to be non nullable, you must provide a default sql value to upgrade existing null data with.")]
    string DefaultSQLForNotNullable { get; set; }
    Property Value
    Type Description
    string

    Description

    A user friendly description, that the user can see when looking at this field.

    Declaration
    [EntityProperty(SQLType.NVarChar, 2000, true)]
    [EntityDescription("A user friendly description of this custom object.")]
    string Description { get; set; }
    Property Value
    Type Description
    string

    EnumPropertyType

    The enum type of property in the .net class.

    Declaration
    [EntityProperty(SQLType.NVarChar, 500, true)]
    [EntityDescription("The enum type of property in the .net class.")]
    [PropertyValidation("true", "LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsPropertyTypeValid(MyItem)", "The PropertyType and ColumnType are not compatible.")]
    string EnumPropertyType { get; set; }
    Property Value
    Type Description
    string

    Formula

    A formula that is run to determine the value of this property and is run whenever dependant properties change value

    Declaration
    [EntityProperty(SQLType.NVarChar, true)]
    [EntityDescription("A formula that is run to determine the value of this property and is run whenever dependant properties change value.")]
    string Formula { get; set; }
    Property Value
    Type Description
    string

    IsDate

    If this property is a datetimeoffset this indicates if it only holds the date component or the date and time?

    Declaration
    [EntityProperty(SQLType.Bit, false, "0")]
    [EntityDescription("If this property is a datetimeoffset this indicates if it only holds the date component or the date and time?")]
    bool IsDate { get; set; }
    Property Value
    Type Description
    bool

    IsIndex

    A smallint that indicates this column should be used as an index column when in a grid indicating order

    Declaration
    [EntityProperty(SQLType.Bit, false, "0")]
    [EntityDescription("A smallint that indicates this column should be used as an index column when in a grid indicating order.")]
    bool IsIndex { get; set; }
    Property Value
    Type Description
    bool

    IsLabel

    Indicates if this field holds the label to be used when referring to this record. This label is displayed in tab headers when looking at the entity, and in recent and favourite lists, etc.

    Declaration
    [EntityProperty(SQLType.Bit, false, "0")]
    [EntityDescription("Indicates this property holds the label for this record. Will be displayed in the UI to identify this record instance.")]
    bool IsLabel { get; set; }
    Property Value
    Type Description
    bool

    IsNullable

    Indicates if this field can legally hold a null value

    Declaration
    [EntityProperty(SQLType.Bit, false)]
    [EntityDescription("Indicates if this property can contain null, or must have a value.")]
    [HardCodedDefaultValueOnNew("1")]
    [DBTrackChanges]
    bool IsNullable { get; set; }
    Property Value
    Type Description
    bool

    IsPartOfKey

    Every record has an internal globally unique identifier. However this check indicates if this property forms part of the key that makes these records unique - such as a Legal Name for a Company. These key fields will be used to uniquely identify records when importing/exporting and from other user identifiable methods.

    Declaration
    [EntityProperty(SQLType.Bit, false)]
    [EntityDescription("Indicates this property forms part of the key that uniquely identifies a record in the table.")]
    bool IsPartOfKey { get; set; }
    Property Value
    Type Description
    bool

    LinkDeleteWithRelationship

    Indicates you want this entity to be automatically deleted (in a cascading delete fashion) when the linked to entity is itself deleted.

    Declaration
    [EntityProperty(SQLType.Bit, false)]
    [EntityDescription("Indicates that this custom object record should be deleted when this linked to entity itself is deleted - cascade delete.")]
    bool LinkDeleteWithRelationship { get; set; }
    Property Value
    Type Description
    bool

    LinkExtendsType

    This indicates the entity has properties that extend the linked type.

    This is different from inheritance as it isn't an instance of the same object and can have its own permissions and so forth.However enabling this means you have a quick way of adding new fields to existing entities throughout the system.

    Declaration
    [EntityProperty(SQLType.Bit, false, "0")]
    [EntityDescription("Indicates thie type extends properties/behaviour of the specified linked type.")]
    [PropertyValidation("MyItem.LinkExtendsType", "await LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsExtendedTypeValid(MyItem, Data)", "You can only have one custom property that is a relationship that extends another type per custom entity.")]
    bool LinkExtendsType { get; set; }
    Property Value
    Type Description
    bool

    LinkInheritPermissions

    Indicates this entity should inherit permissions from the specified entity.

    Declaration
    [EntityProperty(SQLType.Bit, false)]
    [EntityDescription("Indicates that this record should inherit permissions from this linked to record.")]
    [PropertyValidation("MyItem.LinkInheritPermissions", "await LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsPermissionValid(MyItem, Data)", "Either the custom object itself can have permissions, or only *one* custom property can be marked to inherit permissions via a relationship.")]
    bool LinkInheritPermissions { get; set; }
    Property Value
    Type Description
    bool

    LinkPartOfParentSet

    Indicates this entity is part of a set of entities that this linked to entity is in also.

    For instance a Parent Item may have a Child Item with a relationship pointing to the Parent Item and this set to true. That would make the Child Item a part of this set and when exporting in xml the Child Item would be included as part of the set of data.

    Declaration
    [EntityProperty(SQLType.Bit, false)]
    [EntityDescription("Indicates that this custom object is a part of the parent linked to entity, and should be included in any export/import set.")]
    bool LinkPartOfParentSet { get; set; }
    Property Value
    Type Description
    bool

    LinkPreventAutoConstraint

    Prevent LemonEdge from creating constraints in sql for this relationship to enforce its validity. This can improve performance on certain bulk loading tables.

    Declaration
    [EntityProperty(SQLType.Bit, false)]
    [EntityDescription("Indicates whether the system should create any constraints in the database adhering to this relationship.")]
    bool LinkPreventAutoConstraint { get; set; }
    Property Value
    Type Description
    bool

    LinkToItemInSet

    Indicates this linked to item is also part of a set, but not through a parent/child relationship and is just an associated item that may be the parent of its own set of data too.

    Declaration
    [EntityProperty(SQLType.Bit, false)]
    [EntityDescription("Indicates that object this item links to should be included in any import/export set.")]
    bool LinkToItemInSet { get; set; }
    Property Value
    Type Description
    bool

    LinkToType

    The type of entity you want this relationship to link to

    Declaration
    [EntityProperty(SQLType.UniqueIdentifier, true, IsEntityTypeLink = true)]
    [EntityDescription("The type of entity definition this property holds a link to.")]
    [PropertyValidation("MyItem.LinkToType.HasValue", "await LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsRelationshipValid(MyItem, Data)", "The type of this property does not match the type of the property on the linked to object. If it is linking to the ID, it should be a SQL Type of uniqueidentifier with a Property Type of Guid.")]
    Guid? LinkToType { get; set; }
    Property Value
    Type Description
    Guid?

    LinkToTypePropertyName

    The property on the target entity of this relationship that holds a uniquely identifying field.

    This is typically always ID - the internal global unique identifier.

    Declaration
    [EntityProperty(SQLType.NVarChar, 500, true)]
    [EntityDescription("The property on the LintoType entity that this property holds a link to.")]
    [PropertyValidation("MyItem.LinkToType.HasValue", "!string.IsNullOrEmpty(MyItem.LinkToTypePropertyName)", "You must select a PropertyName to link the relationship to if you have selected an entity this property links to.")]
    string LinkToTypePropertyName { get; set; }
    Property Value
    Type Description
    string

    OnPropertyChangeScript

    A statement that is run whenever this specified property changes. This is run within the OnPropertyChanged partial method on the class.

    Declaration
    [EntityProperty(SQLType.NVarChar, true)]
    [EntityDescription("A statement that is run whenever this specified property changes. This is run within the OnPropertyChanged partial method on the class.")]
    string OnPropertyChangeScript { get; set; }
    Property Value
    Type Description
    string

    PropertyName

    A unique (within this entity) name of the property for this field. This is the name of the property the class for this entity will have. Normally this is the same as the ColumnName, but can be different.

    Declaration
    [EntityProperty(SQLType.NVarChar, 500, false)]
    [EntityDescription("The name of this custom object property - the property name that will be used for the entity record.")]
    [PropertyValidation("true", "!string.Equals(MyItem.PropertyName, \"AccountID\", StringComparison.CurrentCultureIgnoreCase)", "The AccountID name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.PropertyName, \"CanvasID\", StringComparison.CurrentCultureIgnoreCase)", "The CanvasID name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.PropertyName, \"ID\", StringComparison.CurrentCultureIgnoreCase)", "The ID name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.PropertyName, \"LastUpdated\", StringComparison.CurrentCultureIgnoreCase)", "The LastUpdated name is a reserved word already used by the system, please use another.")]
    [PropertyValidation("true", "!string.Equals(MyItem.PropertyName, \"ModifiedByUserID\", StringComparison.CurrentCultureIgnoreCase)", "The ModifiedByUserID name is a reserved word already used by the system, please use another.")]
    [DatabasePropertyValidation("true", "await LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsPropertyNameValid(MyItem, Data)", "The PropertyName is invalid.")]
    [Required(AllowEmptyStrings = false)]
    [FileSafeNameValidation]
    string PropertyName { get; set; }
    Property Value
    Type Description
    string

    PropertyType

    The type of property in the .net class.

    Declaration
    [EntityProperty(SQLType.NVarChar, 500, false)]
    [EntityDescription("The type of property in the .net class.")]
    [Required(AllowEmptyStrings = false)]
    [PropertyValidation("true", "LemonEdge.API.Entities.Design.CustomObjectPropertyValidateLinks.IsPropertyTypeValid(MyItem)", "The PropertyType and ColumnType are not compatible.")]
    [HardCodedDefaultValueOnNew("System.Int64")]
    string PropertyType { get; set; }
    Property Value
    Type Description
    string

    UserFriendlyName

    The user friendly name of this custom object column - the name the user will see.

    Declaration
    [EntityProperty(SQLType.NVarChar, 500, false, "ColumnName")]
    [EntityDescription("The user friendly name of this custom object column - the name the user will see.")]
    [Required(AllowEmptyStrings = false)]
    string UserFriendlyName { get; set; }
    Property Value
    Type Description
    string

    ValidationFormula

    The validation formula to apply when this property changes. EValuations failing this check will prevent the changes being committed and will display the ValidationMessage.

    Declaration
    [EntityProperty(SQLType.NVarChar, true)]
    [EntityDescription("The validation formula to apply when this property changes. EValuations failing this check will prevent the changes being committed and will display the ValidationMessage.")]
    string ValidationFormula { get; set; }
    Property Value
    Type Description
    string

    ValidationGateFormula

    If you are applying a ValidationFormula, you can optionally also apply a gate formula which will only evaluate the validation formula if this is true.

    Declaration
    [EntityProperty(SQLType.NVarChar, true)]
    [EntityDescription("If you are applying a ValidationFormula, you can optionally also apply a gate formula which will only evaluate the validation formula if this is true.")]
    string ValidationGateFormula { get; set; }
    Property Value
    Type Description
    string

    ValidationMessage

    The validation formula to apply when this property changes. EValuations failing this check will prevent the changes being committed and will display the ValidationMessage.

    Declaration
    [EntityProperty(SQLType.NVarChar, true)]
    [EntityDescription("The validation formula to apply when this property changes. EValuations failing this check will prevent the changes being committed and will display the ValidationMessage.")]
    string ValidationMessage { get; set; }
    Property Value
    Type Description
    string

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)

    See Also

    ICustomObject
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.