Introduction
This is where you can define any custom methods you want to be able to call from the entity. At any time, you can edit these details to change the way the entity behaves or relates to other objects in your project.
Prerequisites
- An entity must already exist.
- No method with the same name should already exist (duplicate method names are not allowed).
|
Quick Steps |
| 1 |
Search for and open the entity |
| 2 |
Open the Methods section, then open the Load section |
| 3 |
Add a method |
| 4 |
Enter the method properties |
| 5 |
Add properties to the method |
| 6 |
Enter the property details, then click OK |
| 7 |
Save the entity |
Detailed Steps
Step 1. Search for and open the entity.
This example uses the Order Details entity.
Step 2. Open the Methods section, then open the Load section.
This is where you can manage load methods in the entity.
Step 3. Add a method.
In the Load section, click the + icon to add a new method.
Step 4. Enter the method properties.
The important properties are:
- Name: Programmatic ID of the method.
- Description: Text that describes what the method does.
- Load Method: If checked, the method can be used to load the data on the forms. You can also specify the mode for which the load method can be called. Options are New, Update, or All.
- Load Main CDO: If checked, this will load the entity from the table it is bound to. If you do not want to use the default query to load data from the main table, you can specify the load query.
Step 5. Add properties to the method.
Click the plus icon below the method to add a property to your new method.
Step 6. Enter the property details, then click OK.
The important details are:
- Type: Specifies the type for the load method.
- Name: Programmatic ID of the method property.
- Parameter: Navigation parameter (populates automatically, if any).
- Load Type: Specifies whether to only create the object or create the object and perform associated operations.
- Load Source: Based on the Load Type, opens the load source if applicable (among none, specific column, or query to be loaded).
- Order By: Used to sort the result set by a list of columns.
- Sort Order: Used to sort the result set in ascending or descending order.
The Types are:
Attributes: Name of the attribute. This is the meaningful name Xelence will use everywhere it refers to the attribute.
Rule: Combination of condition(s) and action(s) that form the business decision.
Load Method: This will execute the method to load the collection or object.
The Load Types are:
None: This just creates the object.
Foreign Key: This creates the object and executes a query with all columns for the table associated with that method. The query uses the primary key as its where clause (where
primary_key = @primary_key).
Query: This creates the object and populates the main cdo property with the column of the query result.
WebAPI: This creates the object and returns data that is mapped to the object. You need to select the API ID in the Load Source field for this.
Connector: This loads the data in the object. You must enter the connector details in the Load Source.
AutoLoad: This automatically loads the object based on database keys.
Tip: If the method passes a parameter, the controls that use that parameter will require it as a property. You can assign certain parameters directly on such controls, but it must be passed from the method where they are called.
Step 7. Save the entity.
What are the improvements over S3 Version 6?
The process is identical.
Related Articles
Edit a Load Method
Delete a Load Method
This post is part of the Entity topic. Click here to open the Entity Overview.
#Xelence
#Entity