Every time Xelence opens an entity, it displays the Design tab of that entity. This is where you can maintain the entity properties that determine how the data behaves in your app.
These properties are managed in the Entity Tree, which is divided into sections:
- Attributes
- Queries
- Conditions
- Constraints
- Methods
- Delete
- Groups
- CheckList
- Forms
- Rules
- Correspondence
- Database
Attributes Section:
Attributes are the properties that describe the entity. The Attributes section is divided into subsections:
- Columns
- Property
- One To One
- One To Many
- Calculated Fields
Columns:
The Columns subsection manages all the columns in the database table on which the entity is based. It is further divided into tabs, Columns and System Column.
A System Column is a default column that manages metadata about any record based on the entity. System Columns are: Created By, Created Data, Modified By, Modified Date, and Update Seq.
A Column is a property that is mapped to a piece of meaningful data that corresponds to a database table column. For example, if a record based on the entity displays Last Name data, that comes from a Column.
The Columns subsection uses the following properties to manage each Column and System Column:
- ID: Programmatic ID of the column when called from the entity.
- Data Type: Type of data that can be stored in the column (int, string, etc.).
- Column Name: Programmatic ID of the column when called from its table.
- Length: Maximum number of characters allowed.
- Allow Null: Indicates if the column can accept null values.
- Required: Indicates whether your app will always require a value for this column.
- Min: Minimum value accepted for the column.
- Max: Maximum value accepted for the column.
- Caption: Text your app will use to identify the column on other files, such as forms.
These are the main properties you may see at a glance for all table columns. If you select an individual column, you may also view its other properties in the Properties tab to the right.
Property:
The Property subsection lists all the custom attributes added to the entity (not initially created as mapped to the entity table). It uses the following properties:
- ID: Programmatic ID of the property.
- Data Type: Type of data that can be stored in the property (int, string, etc.).
- Is List: If checked, the property can add items to/remove items from a list (collection).
- Access Modifier: Determines what other files can call the property.
- Caption: Text your app will use to identify the property on other files.
These are the main properties you may see at a glance for all properties. If you select an individual property, you may also view its other properties in the Properties tab to the right.
One To One:
The One To One subsection lists all the relationships the entity has with other entities on a one to one basis (this entity is the child in such a relationship). For example, you could have an Order entity whose relationship with a Customer entity is one to one (Order is a child of Customer). This subsection uses the following properties:
- ID: Programmatic ID of the relationship attribute. This is always prefixed with obj.
- Entity: Entity the relationship is with.
- Access Modifier: Determines what other files can call the object.
- Description: Text description of the object.
These are the main properties you may see at a glance for all one to one relationships. If you select an individual item, you may also view its other properties in the Properties tab to the right.
One To Many:
The One To Many subsection lists all the relationships the entity has with other entities on a one to many basis (this entity is the parent in such a relationship). For example, you could have a Customer entity whose relationship with an Order entity is one to many (Customer is the parent of Order). This subsection uses the following properties:
- ID: Programmatic ID of the relationship attribute. This is always prefixed with lst.
- Entity: Entity the relationship is with.
- Access Modifier: Determines what other files can call the lst (collection).
- Description: Text description of the collection.
These are the main properties you may see at a glance for all one to many relationships. If you select an individual item, you may also view its other properties in the Properties tab to the right.
Calculated Fields:
The Calculated Fields subsection lists all the read-only properties that return a calculated value. It uses the following properties:
- Name: Programmatic ID of the calculated field.
- Access Modifier: Determines what other files can call the calculated field.
- DataType: Type of data that can be stored in the calculated field (int, string, etc.).
- Description: Text description of the calculated field.
From the subsection or from the Entity Tree, you can open a newly created field and code it to calculate the desired value via a graphic flowchart, or via C#. Once coded, you can view/updated it the same way.
Queries Section:
The Queries subsection lists all the SQL statements the entity uses to manage its data.
In the Entity Tree, this subsection is further divided into Groups, which are curated collections of queries. You can select a Group from the Entity Tree to view a table of all the queries it contains.
If you don't select a group, the Queries subsection uses the following properties:
- Group Name: Identifies the Group the query is in. All queries must belong to a Group.
- Name: Programmatic name of the query.
- Query Type: Determines what the query does. Options are:
- SelectQuery: The query returns table data.
- SubSelectQuery: The query only executes as a where clause in another query.
- ScalarQuery: The query returns a count.
- NonQuery: The query executes SQL that does not query data.
- Return Type: Identifies what the query returns.
From the subsection, specific Group, or Entity Tree, you can open a query to view/update it. If you select an individual item, you can view its other properties in the Properties tab.
Conditions Section:
Conditions define the items that the entity uses to apply logic to the data. The Conditions subsection is divided into two subsections: Expression and Rule.
From the subsection or Entity Tree, you can open a condition to view/update it. If you select an individual condition, you can view its properties in the Properties tab.
Expression:
The Expression subsection lists all the items that define a state for entity data and a message to display whenever the data meets that state. It uses the following properties:
- Condition ID: Programmatic ID of the expression.
- Access Modifier: Determines what other files can call the expression.
- Message ID: Programmatic ID of the message that displays if the expression is true.
From the subsection or Entity Tree, you can open an expression to view/update it. If you select an individual expression, you can view its properties in the Properties tab.
Rule:
The Rule subsection lists all the items that define logic that returns a value. It uses the following properties:
- Name: Programmatic ID of the rule.
- Access Modifier: Determines what other files can call the rule.
- Description: Text description of the rule.
From the subsection or Entity Tree, you can open a rule to view/update it. If you select an individual rule, you can view its properties in the Properties tab.
Constraints Section:
Constraints define data validations that determine your users' ability to process app data if they are true. The Constraints section is divided into subsections:
Delete:
The Delete subsection lists all the constraints that prevent users from deleting app data if they are true. It uses the following properties:
- Condition ID: Identifies the condition that prevents users from deleting app data if it is true.
- PreCondition ID: Identifies the condition that causes checking for the delete condition if it (the precondition) is true.
- Mode: Determines the circumstances under which the delete constraint applies.
- Status: Determines whether the delete constraint is in effect.
Select a Delete constraint to view its properties in the Properties tab.
Field:
The Field subsection lists all the data constraints that prevent users from saving app data if they are true. It uses the following properties:
- Attribute Name: Identifies the data the constraint is for.
- Required: Indicates whether the constraint is that the data is required (may not be null).
- Min: Minimum value allowed for the data.
- Max: Maximum value allowed for the data.
- Compare: Indicates whether the constraint is that the data must have a certain relationship with another piece of entity data.
Select a Field constraint to view its properties in the Properties tab.
Server:
The Server subsection lists all the constraints that prevent users from saving app data if they are true. It uses the following properties:
- Condition ID: Identifies the condition that prevents users from saving app data if it is true.
- PreCondition ID: Identifies the condition that causes checking for the server condition if it (the precondition) is true.
- Mode: Determines the circumstances under which the server constraint applies.
- Status: Determines whether the server constraint is in effect.
Select a Server constraint to view its properties in the Properties tab.
Soft:
The Soft subsection lists all the constraints that prevent records based on the entity from being in Valid status if they are true.
- Condition ID: Identifies the condition that prevents the record from being valid if it is true.
- PreCondition ID: Identifies the condition that causes checking for the soft condition if it (the precondition) is true.
- Mode: Determines the circumstances under which the soft constraint applies.
- Status: Determines whether the soft constraint is in effect.
Select a Soft constraint to view its properties in the Properties tab.
Methods Section:
The Methods section lists all the entity's custom XML methods. Its only subsection is Load.
Load:
The Load subsection lists all the entity's custom XML load methods. It uses the following properties:
- Method ID: Programmatic ID of the method.
- Mode: Determines the circumstances under which your app executes the method.
- Method Type: The only method type you can create is Load.
- Description: Text description of the method.
- Load Main CDO: Indicates whether the method loads the entity's custom data object.
Select a Load method to view its properties in the Properties tab.
Delete Section:
The Delete section defines the order in which any delete operation executes. For example, if your entity is a parent of one or more child entities, it must have a delete order that removes the child objects before deleting the parent object. If you have a Customer entity with a child Order entity, and a user submits a request to delete a Customer record, such a configured order ensures that the operation will first delete any Order records that belong to the Customer before deleting the Customer record. Otherwise, a user could attempt to access an Order that doesn't belong to any Customer.
The Delete section uses the following properties:
- ID: Identifies the collection to delete.
- Foreign Key: Identifies the collection's foreign key.
Select an item to view its properties in the Properties tab.
Groups Section:
The Groups subsection lists all the conditions that apply to wizards that use the entity.
In the Entity Tree, this subsection is further divided into Groups, which are curated collections of conditions that apply to the wizard steps in which they are called. You can select a Group from the Entity Tree to view a table of all the conditions it contains.
If you don't select a group, the Groups subsection uses the following properties:
- Group Name: Identifies the Group the condition is in.
- Condition ID: Programmatic name of the condition.
- PreCondition ID: Programmatic name of the condition that has to be true to apply the condition identified by the Condition ID.
- Mode: Determines the circumstance under which the app applies the condition.
- Status: Determines whether the condition is in effect.
From the subsection, specific Group, or Entity Tree, you can select an individual item to view its other properties in the Properties tab.
CheckList Section:
The CheckList subsection lists the item for the entity checklist. It uses the following properties:
- Condition ID: Identifies the condition the item uses.
- PickList Value: Value the item uses (the checklist is based on a PickList ID configured at the entity level).
- Mode: Determines the circumstances under which the app applies the item.
- Status: Determines whether the item is in effect.
Select an individual item to view its properties in the Properties tab.
Forms Section:
The Forms section lists all the forms that are based on the entity. Click a form to view it.
Rules Section:
The Rules section lists all the rules that are based on the entity. Click a rule to view it.
Correspondence Section:
The Correspondence section lists all the correspondences that are based on the entity. Click a correspondence to view it.
Database Section:
The Database section is divided into two subsections: Foreign Keys and Indexes.
Foreign Keys:
The Foreign Keys subsection lists all the entity's foreign keys. It uses the following properties:
- Foreign Key Name: Programmatic database ID of the foreign key.
- Column Name: Identifies the foreign key in the entity's table.
- Parent Table Name: Identifies the parent table the foreign key is for.
- Parent Column Name: Identifies the parent table's key.
Indexes:
The Indexes subsection lists all the entity's indexes. It uses the following properties:
- Index Name: Programmatic name of the index.
- Index Type: This is always Nonclustered.
- Columns: Identifies the columns.
This post is part of the Entity topic. Click here to open the Entity Overview.
#Entity