Class CustomObject
Implements
Inherited Members
Namespace: LemonEdge.API.Entities.Design
Assembly: LemonEdge.API.Entities.Auto.dll
Syntax
[DataContract]
[DatabaseClassValidation(typeof(CustomObjectValidation), "ValidateObject")]
public class CustomObject : BaseEntityWithPermissions, ICustomObject, IBaseEntityWithPermissions, ISetCopier, IHasSaveProcessingTask, IShareAcrossAccounts, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties, ICloneableAsync<ICustomObject>, ISetCopierCloneAlterer
Constructors
CustomObject()
Declaration
public CustomObject()
Properties
CollectionName
The unique name for a collection of these items. Usually just the plural of the Name.
Declaration
[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.")]
[StringLength(500)]
public string CollectionName { get; set; }
Property Value
Type | Description |
---|---|
string |
CopierCloneType
Declaration
public SetCopierCloneType CopierCloneType { get; set; }
Property Value
Type | Description |
---|---|
SetCopierCloneType |
Description
A user friendly description of this custom object.
Declaration
[StringLength(2000)]
public 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
public bool HasPermissions { get; set; }
Property Value
Type | Description |
---|---|
bool |
IconID
The id of a system or ImageID
Declaration
public 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
public 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
public 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
public bool IsRootOfEntitySet { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsShared
Indicates this record is a shared record. Only the root account can edit items that are shared records
Declaration
public bool IsShared { 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
public 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
public bool LoadDynamically { get; set; }
Property Value
Type | Description |
---|---|
bool |
Name
[Key] The unique name for this Custom Object
Declaration
[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.")]
[StringLength(500)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
PriorRunTaskParam
Holds the task parameters used when this was previously run. SavedTaskParam is cleared after processing to distinguish between imports and other operations.
Declaration
public byte[] PriorRunTaskParam { get; set; }
Property Value
Type | Description |
---|---|
byte[] |
SavedTaskID
Links to IServerTask. Indicates the task that has been automatically created during the save process for completing any further processing
Declaration
public Guid? SavedTaskID { get; set; }
Property Value
Type | Description |
---|---|
Guid? |
SavedTaskID_Label
Declaration
public string SavedTaskID_Label { get; set; }
Property Value
Type | Description |
---|---|
string |
SavedTaskID_Label_Silent
Declaration
[NotMapped]
public string SavedTaskID_Label_Silent { get; set; }
Property Value
Type | Description |
---|---|
string |
SavedTaskParam
Holds the associated parameters for the task SavedTaskID
Declaration
public byte[] SavedTaskParam { get; set; }
Property Value
Type | Description |
---|---|
byte[] |
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
public Guid? SharedKey { get; set; }
Property Value
Type | Description |
---|---|
Guid? |
StorageType
Declaration
[EnumDataType(typeof(CustomObjectStorage))]
public CustomObjectStorage StorageType { get; set; }
Property Value
Type | Description |
---|---|
CustomObjectStorage |
StorageType_Tooltip
Declaration
[NotMapped]
public string StorageType_Tooltip { get; set; }
Property Value
Type | Description |
---|---|
string |
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
[Unique]
[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.")]
[StringLength(500)]
public string TableName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
AlterCopiedItem(IEntityUpdater, UserInfo, IReadOnlyCache, IBaseEntity)
A custom ability to alter this item when it is was copied by the user in the UI, not when it is being imported
Declaration
public Task AlterCopiedItem(IEntityUpdater host, UserInfo user, IReadOnlyCache cache, IBaseEntity sourceItem)
Parameters
Type | Name | Description |
---|---|---|
IEntityUpdater | host | The context this item was copied into |
UserInfo | user | The current user |
IReadOnlyCache | cache | The current local cache |
IBaseEntity | sourceItem | The original source item this item was copied from |
Returns
Type | Description |
---|---|
Task | A task inidicating the finishing of this method |
CopyFromEntity(IBaseEntity)
Declaration
protected override void CopyFromEntity(IBaseEntity src)
Parameters
Type | Name | Description |
---|---|---|
IBaseEntity | src |
Overrides
CopyFromSource(ICustomObject)
Updates all properties in this item to have the same properties as the source object.
Declaration
public void CopyFromSource(ICustomObject source)
Parameters
Type | Name | Description |
---|---|---|
ICustomObject | source | The source object to copy all values from. |
GetPropertyValue(ISetItemInfo, string, object)
Declaration
public object GetPropertyValue(ISetItemInfo info, string propName, object currentValue)
Parameters
Type | Name | Description |
---|---|---|
ISetItemInfo | info | |
string | propName | |
object | currentValue |
Returns
Type | Description |
---|---|
object |
GetShouldAutoGenerateTaskOnSave()
Indicates if the task should automatically be generated on save
Only runs on the service, or directly connected to db. Defaults to true
So ensure processors that implement IBaseDataSetProcessorWithDBSave correctly set this for the task to be auto created or not on saveDeclaration
public bool GetShouldAutoGenerateTaskOnSave()
Returns
Type | Description |
---|---|
bool | If the task should automatically be generated on save |
SetAutoGenerateOnSave(bool)
Sets if thie task should be generated for this item on save or not
Declaration
public void SetAutoGenerateOnSave(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value | Indicates if the task should be generated on save or not |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |