Table of Contents


Entity Types

 

What Are Entities?

Data classes which are stored in the Magentrix database are referred to as Entities. When thinking about Entities, think of Database Tables with business logic and built-in security added. Entities are recognized by their name, and at minimum they have an ID property that allows the records of that Entity to be uniquely identified. Most Entities have additional properties and fields. Some of these are added by the system, such as Audit fields (CreatedBy, ModifiedBy, CreatedOn, ModifiedOn) and others depend on the type of Entity (Name, Firstname/Lastname). Administrators and developers can also add custom fields. Magentrix allows organizations to build native Entities as well as Entities that are imported from other applications such as Salesforce.com CRM.

 

Entity Types

Magentrix native Entities support two Entity types:

  1. Person
  2. Object

 

Person Entity

Person entities have built-in properties of a person, such as First Name, Last Name, etc. The Name field is a calculated field that combines the First Name and Last Name values. This entity type is suitable for tracking and managing information such as Contacts, Leads, Students, etc. 
 

Object Entity

Object Entities have a Name field, which can be an auto-number or text field. This entity type is suitable for tracking data for things such as Opportunities, Quotes, Orders, Invoices, etc.


All entities in Magentrix are a subclass of the "dbObject" class. The dbObject class has the following properties and methods:

 

Properties

NameTypeDescription
IdstringRecord ID is stored in a database.
IsModelValidbool

Determines that there is no validation errors on the Model (class). The property is read only and is set to true when you call the "AddError" method.

 

Methods

NameReturn TypeDescription
AddError(string message)voidAdds an error to the model state.
AddError(string fieldName, string message)voidAdds an error to the model state which is associated with a specific property/field.
AddError(Exception ex)voidAdds an error to the model state.
AddError(string fieldName, Exception ex)voidAdds an error to the model state which is associated with a specific property/field.
Get(string fieldName)object

Gets a field value.

Set(string fieldName, object value)voidSets a field value.

 

The dbObject class also provides access to the following "static" methods:

NameReturn TypeDescription
dbObject.GetEntityType(string entityName)TypeReturns the class type of the given entity.
dbObject.GetInstance(string entityName)objectReturns a new instance of the entity model.