View Article

Update the Entity's Database Table

By Xelence Documentation posted 04-29-2022 10:09

  

Introduction

There are three ways you can update the entity's table in Xelence. If the table the entity is based on needs to be updated with new columns, you can manually add columns to the table and attributes for those columns so Xelence will call those columns wherever your project refers to the attributes. If the table needs to be updated with the primary key of another table, you can add a foreign key to the entity's table to link both tables. Finally, you can add an index to the table to enable users to find records they need to search for frequently.

Prerequisites

  • The entity must already exist.
  • No attribute with the same name may exist.
 Quick Steps
1 Search for and open the entity
2 Open the Attributes section
3 Open the Columns section, then click the Alter Table button
4 To add a column, open the Columns tab
5 Add a column, then enter the column details
6 To add a foreign key, open the Foreign Keys tab and add a foreign key
7 Enter the foreign key details
8 To add an index, open the Indexes tab and add an index
9 Add columns to the index, then enter the column details
10 Click OK
11 Click Finish
12 Save the entity

Detailed Steps

Step 1. Search for and open the entity.

Open the entity whose database table you want to update.


Step 2. Open the Attributes section.

The Attributes section is where you can add/modify any attribute. 


Step 3. Open the Columns section, then click the Alter Table button.

The Columns section is where you can view, add, and delete attributes in the entity. 

Click the Alter Table button. This opens the window where you will be updating the table.



Step 4. To add a column, open the Columns tab.


Step 5. Add a column, then enter the column details.

Click the Add Columns button to add a new column. 


Enter the attribute details. The properties are:

  • ID: Programmatic name of the attribute that populates from the Column Name.
  • Column Name: The column name from the database table. Xelence will link this to the attribute name and pull it wherever the user refers to the attribute.
  • Data Type: Defines the values the attribute can take.
  • UDT: User Data Type, if defined in the application, can be mapped to the table column at the time of entity creation.
  • Picklist: The Picklist value can be entered if the data type is set as Picklist. It can be specified by users at the time of entity creation (during the Create New Item wizard). Picklists can be modified later, if required.
  • Length: Maximum length allowed if the Data Type is varchar.
  • Allow Null: Determines whether the attribute can be null wherever it’s called.
Tip: The different types of data types available for attributes are: string, bool, decimal, double, float, int, long, short, uniqueidentifier, varbinary, binary, datetime, and Picklist.



Step 6. To add a foreign key, open the Foreign Keys tab and add a foreign key.

Click the + icon to add a foreign key.



Step 7. Enter the foreign key details.

The properties are:

  • Column Name: The column name from the database table. Xelence will link this to the attribute name and pull it wherever the user refers to the attribute.
  • Parent Table: The table where the foreign key is the primary key.
  • Parent Column Name: The primary key of the parent table, which is the foreign key of this entity's table.



Step 8. To add an index, open the Indexes tab and add an index.

Click the + icon to add a new index.

Any index you add to the database will be non-clustered. A non-clustered index is a structure separate from the data stored in a table. It reorders one or more selected 
columns. By default, a clustered index on the primary key column is created when the entity gets created.



Step 9. Add columns to the index, then enter the column details.

Xelence displays a window for configuring the index. Click the Add Item icon to add a column to the index.

The properties are:

  • Column Name: The column name from the database table.
  • Order: Determines how the results are sorted, ascending or descending.



Step 10. Click OK.

Xelence adds the index.


Step 11. Click Finish.

When you are finished updating the entity's table, click Finish.



Step 12. Save the entity.

Click the icon to save your entity file.


What are the improvements over S3 Version 6?

This is a new process.


Related Articles

Update an Entity

Update a Property in the Entity

This post is part of the Entity topic. Click here to open the Entity Overview.


#Xelence
#Entity

0 comments
142 views