Interface ICustomObjectProperty
The system entity for a Custom Object Property, which belongs to a ICustomObject
See https://web.lemonedge.com/help/custom-entity-properties/ for more information
Inherited Members
Namespace: LemonEdge.API.Entities
Assembly: API.dll
Syntax
[EntityDefinition(EntityID.CustomObjectProperty, "dbo.LT_CustomObjectProperties", "CustomObjectProperty", LabelColumn = "PropertyName", IsStandingDataEntity = true)]
[DefaultEntityIcon(ImageType.DataTableColumn)]
public interface ICustomObjectProperty : IShareAcrossAccounts, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties
Properties
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 |
---|---|
System.Nullable<System.Int16> |
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, (short)500, false)]
[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 |
---|---|
System.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 |
---|---|
System.Nullable<System.Int16> |
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 |
---|---|
System.Nullable<System.Int16> |
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.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, "CustomObject", "CustomObjectProperty", DeleteWithRelationship = true, PartOfParentSet = true, InheritPermissions = true)]
Guid CustomObjectID { get; set; }
Property Value
Type | Description |
---|---|
System.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, (short)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.")]
string DefaultSQLForNotNullable { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Description
A user friendly description, that the user can see when looking at this field.
Declaration
[EntityProperty(SQLType.NVarChar, (short)2000, true)]
[EntityDescription("A user friendly description of this custom object.")]
string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 |
---|---|
System.Boolean |
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.")]
bool IsNullable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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.")]
bool LinkInheritPermissions { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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", "LemonEdge.API.Entities.CustomObjectPropertyValidateLinks.IsRelationshipValid(MyItem)", "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 |
---|---|
System.Nullable<System.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, (short)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 |
---|---|
System.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, (short)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.CustomObjectPropertyValidateLinks.IsPropertyNameValid(MyItem, Data)", "The PropertyName is invalid.")]
[Required(AllowEmptyStrings = false)]
[FileSafeNameValidation]
string PropertyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PropertyType
The type of property in the .net class.
Declaration
[EntityProperty(SQLType.NVarChar, (short)500, false)]
[EntityDescription("The type of property in the .net class.")]
[Required(AllowEmptyStrings = false)]
[PropertyValidation("true", "LemonEdge.API.Entities.CustomObjectPropertyValidateLinks.IsPropertyTypeValid(MyItem)", "The PropertyType and ColumnType are not compatible.")]
[HardCodedDefaultValueOnNew("System.Int64")]
string PropertyType { get; set; }
Property Value
Type | Description |
---|---|
System.String |
UserFriendlyNameName
The user friendly name of this custom object column - the name the user will see.
Declaration
[EntityProperty(SQLType.NVarChar, (short)500, false, "ColumnName")]
[EntityDescription("The user friendly name of this custom object column - the name the user will see.")]
[Required(AllowEmptyStrings = false)]
string UserFriendlyNameName { get; set; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.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 |
---|---|
System.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 |
---|---|
System.String |