Interface ICustomObject
The system entity for a Custom Object, which holds the design of an entity within the lemonedge platform
See https://web.lemonedge.com/help/custom-entities/ for more information
Inherited Members
Namespace: LemonEdge.API.Entities
Assembly: API.dll
Syntax
[EntityDefinition(EntityID.CustomObject, "dbo.LT_CustomObjects", "CustomObject", LabelColumn = "Name", IsStandingDataEntity = true, HelpURL = "custom-entities")]
[DefaultEntityIcon(ImageType.EntityDefinition)]
public interface ICustomObject : IBaseEntityWithPermissions, ISetCopier, IHasSaveProcessingTask, IShareAcrossAccounts, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties
Properties
CollectionName
The unique name for a collection of these items. Usually just the plural of the Name.
Declaration
[EntityProperty(SQLType.NVarChar, (short)500, false)]
[EntityDescription("The unique collection name of this custom object.")]
[FileSafeNameValidation]
[Required(AllowEmptyStrings = false)]
[PropertyValidation("true", "MyItem.CollectionName != MyItem.Name", "The Name and CollectionName for a custom object must be different.")]
[PropertyValidation("true", "!LemonEdge.Core.Descriptors.EntityDescriptorFactory.GetDescriptors().Any(x => x.TypeID != (MyItem.SharedKey ?? MyItem.ID) && string.Equals(x.SetName, MyItem.CollectionName, StringComparison.CurrentCultureIgnoreCase))", "An entity (either custom, system or via an AddIn) with that collection name already exists. You must use a different one.")]
string CollectionName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Description
A user friendly description of this custom object.
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 |
ExtendsType
This indicates the entity has properties that extend a related 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.UniqueIdentifier, true, IsEntityTypeLink = true)]
[EntityDescription("Indicates thie type extends properties/behaviour of the specified entity definition.")]
Guid? ExtendsType { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
HasPermissions
This indicates if your entity has it's own permissions that can be defined by the user. If not it should inherit permissions through a relationship to another entity, if it doesn't the data will have no permissions and can be modified by any user.
Declaration
[EntityProperty(SQLType.Bit, false)]
[EntityDescription("Indicates thie item can individually be permissioned.")]
bool HasPermissions { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IconID
The id of a system or ImageID
Declaration
[EntityProperty(SQLType.UniqueIdentifier, false)]
[EntityDescription("Default icon for this custom object type.")]
Guid IconID { get; set; }
Property Value
Type | Description |
---|---|
System.Guid |
InheritsType
Indicates that this entity inherits the properties of a base entity.
For instance when creating objects that are tied to the transaction engine they need to inherit the entity IInstrument.
Declaration
[EntityProperty(SQLType.UniqueIdentifier, true, IsEntityTypeLink = true)]
[EntityDescription("Indicates thie type inherits properties/behaviour from the specified entity definition. The properties will be stored across the two database tables.")]
Guid? InheritsType { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
IsInheritable
This indicates the entity is a base class entity and has other entities that inherit from this one.
Declaration
[EntityProperty(SQLType.Bit, false)]
[EntityDescription("Indicates this custom object can act as a base type which other entity definitions can inherit from.")]
bool IsInheritable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsRootOfEntitySet
This indicates the object is the root item in a related set of entities.
The system can automatically provide xml import/export packages for the data and its children if this is known.
Declaration
[EntityProperty(SQLType.Bit, false)]
[EntityDescription("Indicates this custom object is the root of a related collection of entity definitions. i.e. A SQLWrapper is the root of sqlwrappercolumns, so the items can be exported/imported as one xml set.")]
bool IsRootOfEntitySet { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsStandingData
This simply indicates the client will automatically load all this data when the application opens. This can speed up the client for data that is frequently referenced.
Declaration
[EntityProperty(SQLType.Bit, false)]
[EntityDescription("Indicates this holds records that are frequently accessed by the system and should be cached by the client/server - i.e. Currencies would be standing data.")]
bool IsStandingData { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
LoadDynamically
This indicates the system will dynamically load your Custom Entity into the system immediately.
The alternative is the designer can provide you the actual code for this entity.You can incorporate that code in your own DLL and add that as an Add-In to the platform itself using our Add-In Modules.
Declaration
[EntityProperty(SQLType.Bit, false)]
[EntityDescription("Indicates this custom object should be dynamically loaded into the system at runtime. IF false, you can also export this item as code, modify it and load it in as an AddIn.")]
bool LoadDynamically { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
[Key] The unique name for this Custom Object
Declaration
[EntityProperty(SQLType.NVarChar, (short)500, false)]
[EntityDescription("The unique name of this custom object.")]
[FileSafeNameValidation]
[Required(AllowEmptyStrings = false)]
[PropertyValidation("true", "MyItem.CollectionName != MyItem.Name", "The Name and CollectionName for a custom object must be different.")]
[PropertyValidation("true", "!LemonEdge.Core.Descriptors.EntityDescriptorFactory.GetDescriptors().Any(x => x.TypeID != (MyItem.SharedKey ?? MyItem.ID) && string.Equals(x.ItemName, MyItem.Name, StringComparison.CurrentCultureIgnoreCase))", "An entity (either custom, system or via an AddIn) with that name already exists. You must use a different one.")]
string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SharedKey
This enables you to specify a unique ID that would be shared across different systems that use the same Custom Entity configuration (You can Export/Import these configurations across different systems). This ensures the system doesn't see two different implementations of the same custom entity.
Declaration
[EntityProperty(SQLType.UniqueIdentifier, true)]
[EntityDescription("If this custom object is shared in more than one database that a service connects to at the same time, this key indicates it's the same shared object and prevents it being loaded twice or more.")]
Guid? SharedKey { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
TableName
This is the name of the table that will actually be created in the database.
All LemonEdge tables start with the prefix LT_
Declaration
[EntityProperty(SQLType.NVarChar, (short)500, false)]
[EntityDescription("The unique table name used to store this custom object data.")]
[Required(AllowEmptyStrings = false)]
[FileSafeNameValidation]
[PropertyValidation("true", "!LemonEdge.Core.Descriptors.EntityDescriptorFactory.GetDescriptors().Any(x => x.TypeID != (MyItem.SharedKey ?? MyItem.ID) && string.Equals(x.TableName.Replace(\"dbo.\", \"\"), MyItem.TableName, StringComparison.CurrentCultureIgnoreCase))", "An entity (either custom, system or via an AddIn) with that table name already exists. You must use a different one.")]
string TableName { get; set; }
Property Value
Type | Description |
---|---|
System.String |