Interface ICustomObject
The system entity for a Custom Object, which holds the design of an entity within the lemonedge platform
See https://help.lemonedge.com/help/api/auto-code-designers/custom-entities/intro.html for more information
Inherited Members
Namespace: LemonEdge.API.Entities.Design
Assembly: LemonEdge.API.dll
Syntax
[EntityDefinition(EntityID.CustomObject, "dbo.LT_CustomObjects", "CustomObject", LabelColumn = "Name", IsStandingDataEntity = true, HelpURL = "help/api/auto-code-designers/custom-entities/intro.html")]
[DefaultEntityIcon(ImageType.EntityDefinition)]
[DatabaseClassValidation(typeof(CustomObjectValidation), "ValidateObject")]
public interface ICustomObject : IBaseEntityWithPermissions, ISetCopier, IHasSaveProcessingTask, IShareAcrossAccounts, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties
Fields
GetDescriptors
Declaration
public const string GetDescriptors = "LemonEdge.API.Descriptors.EntityDescriptorFactory.Instance.GetDescriptors()"
Field Value
Type | Description |
---|---|
string |
Properties
CollectionName
The unique name for a collection of these items. Usually just the plural of the Name.
Declaration
[EntityProperty(SQLType.NVarChar, 500, false)]
[EntityDescription("The unique collection name of this custom object.")]
[Unique]
[FileSafeNameValidation]
[Required(AllowEmptyStrings = false)]
[PropertyValidation("true", "MyItem.CollectionName != MyItem.Name", "The Name and CollectionName for a custom object must be different.")]
[PropertyValidation("true", "!LemonEdge.API.Descriptors.EntityDescriptorFactory.Instance.GetDescriptors().Any(x => (!MyItem.SharedKey.HasValue || x.TypeID != MyItem.SharedKey.Value) && x.TypeID != 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 |
---|---|
string |
Description
A user friendly description of this custom object.
Declaration
[EntityProperty(SQLType.NVarChar, 2000, true)]
[EntityDescription("A user friendly description of this custom object.")]
string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
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 |
---|---|
bool |
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 |
---|---|
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 this 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 |
---|---|
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 |
---|---|
bool |
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 |
---|---|
bool |
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 |
---|---|
bool |
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 |
---|---|
bool |
Name
[Key] The unique name for this Custom Object
Declaration
[EntityProperty(SQLType.NVarChar, 500, false)]
[EntityKeyProperty]
[EntityDescription("The unique name of this custom object.")]
[Unique]
[FileSafeNameValidation]
[Required(AllowEmptyStrings = false)]
[PropertyValidation("true", "MyItem.CollectionName != MyItem.Name", "The Name and CollectionName for a custom object must be different.")]
[PropertyValidation("true", "!LemonEdge.API.Descriptors.EntityDescriptorFactory.Instance.GetDescriptors().Any(x => (!MyItem.SharedKey.HasValue || x.TypeID != MyItem.SharedKey.Value) && x.TypeID != 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 |
---|---|
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.")]
[FormulaDefaultValueOnNew("MyItem.ID")]
[IgnoreOnClone]
Guid? SharedKey { get; set; }
Property Value
Type | Description |
---|---|
Guid? |
StorageType
Declaration
[EntityProperty(SQLType.SmallInt, false, "1")]
[EntityDescription("Indicates if the data should be stored/read from a general user data table (slower performance), or a permanent dedicated database table (requires database upgrade)")]
CustomObjectStorage StorageType { get; set; }
Property Value
Type | Description |
---|---|
CustomObjectStorage |
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, 500, false)]
[Unique]
[EntityDescription("The unique table name used to store this custom object data.")]
[Required(AllowEmptyStrings = false)]
[FileSafeNameValidation]
[PropertyValidation("true", "!LemonEdge.API.Descriptors.EntityDescriptorFactory.Instance.GetDescriptors().Any(x => (!MyItem.SharedKey.HasValue || x.TypeID != MyItem.SharedKey.Value) && x.TypeID != 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 |
---|---|
string |