Entity Types

Entity types are named structured types with a key. They define the named properties and relationships of an entity. The key is formed from a subset of the entity type's primitive properties, such as CustomerId, OrderId, and LineId.

Entity types include this data:

  • Name: The unique identifier for the entity type.
  • Binding: The mapping between the OData property and the LN field.

Restrictions / Standard Actions / Subset Filter

This collapsible section includes restrictions, actions, and a subset filter.

Restrictions
Restrictions are used to control the accessibility and security of data entities.
  • Readable: Determines whether the entity set is readable.
  • ReadableByKey: Determines whether the entity set is readable by key.
Standard Actions
Standard actions are used to perform CRUD operations on entities.
  • Updatable: To update an entity, select the Active check box. Optionally, you can select the Use DLL Function check box and provide the DLL and Function name to execute the specified dll function. If the Use DLL Function check box is cleared, an update is handled by directly calling the Data Access Layer.
  • Insertable: To insert into an entity, select the Active check box. Optionally, you can select the Use DLL Function check box and provide the DLL and Function name to execute the specified dll function. If the Use DLL Function check box is cleared, an update is handled by directly calling the Data Access Layer.
  • Deletable: To delete from an entity, select the Active check box. Optionally, you can select the Use DLL Function check box and provide the DLL and Function name to execute the specified dll function. If the Use DLL Function check box is cleared, an update is handled by directly calling the Data Access Layer.
Subset Filter
A subset filter functions similarly to a WHERE clause in SQL, enabling users to filter data based on specified criteria and retrieve only the matching records during a read action. This helps prevent the exposure of irrelevant data. For example, when reading the current parameters from the Generic Parameters (tcgen000) table, the revision records of previous changes are not relevant. In this scenario, the subset filter (tcgen000.indt = 0) is applied to exclude such records.

Properties

Properties are similar to table columns, defining the individual data elements that an entity type can contain.

Properties include this data:

  • Sequence: The sequence of the property.
  • Active: Indicates whether the property is active or not.
  • Binding: The mapping between the OData property and the LN field.
  • Name: The unique identifier for the property within the entity type.
  • Description: A textual explanation of the property, providing more context or details about its purpose and usage.
  • Type: The data type of the property, such as Edm.String, Edm.Int32, and Edm.Boolean. This defines what kind of data the property can hold.
  • Format: The expected format of the property value, such as date format.
  • Collection: Indicates whether the property is a collection of values (like an array) rather than a single value. This is used for properties that can hold multiple entries.
  • Nullable: Indicates whether the property can have a null value. If selected, the property can be blank. If cleared, it must always have a value.
  • Unicode: Indicates whether the property supports Unicode characters.
  • Default Value: The initial value assigned to the property during an insert if no other value is provided.
  • Domain: Specifies the mapping to an enum in LN.
  • Computed: A computed value for this property is generated by the server logic on both insert and update.
  • Computed Default Value: If no value is provided on insert, a non-static default value is generated.

When you select a property, these options are displayed at the right top corner of the property grid table:

  • Delete: Used to delete the property from the entity.
  • Activate: Used to set an inactive property to active.
  • Deactivate: Used to set a property to inactive.

At the top right corner of the property grid toolbar, these buttons are available:

Add Property
Used to add the property to the Entity Type properties.
More Options (…)
  • Row Height: Used to change the height of the row or change the view of the property table. These options are available: Extra Small, Small, Medium, and Large.
  • Filter: The Show filter row option hides and shows the filter row of the property table. The Clear filter option clears all the applied filters.

At the bottom of the properties table, this kind of information can be displayed:

  • Entity field sequence change is allowed only when the Seq. column is sorted in ascending order.

    It is stated here that you can reorder the fields in the entity property only if their sequence numbers (Seq) are in ascending order, like 1, 2, and 3.

  • Inactive property sequences: 1, 5.

    It is stated here that sequence numbers 1 and 5 are currently inactive.

Calculated Properties

The REST API Modeler for LN supports calculated properties, defined using expressions for simple logic or backend DLL functions for advanced calculations. These can be added directly to the API model and evaluated at runtime without changing the database schema.

Calculated properties include this data:

  • Name: The unique identifier for the calculated property within the entity type.
  • Description: A textual explanation of the calculated property, providing more context or details about its purpose and usage.
  • Type: The data type of the property, such as Edm.String, Edm.Int32, and Edm.Boolean. This defines what kind of data the property can hold.
  • Kind: Select Expression or Function.
    • Expression: The value of the calculated property can be read by adding the expression to the SELECT clause of the main SQL query when fetching data. For more complex logic, select Function. In that case, you must already have defined a 3GL function that calculates/retrieves the value of the calculated property.
    • Function: The user must already have defined a 3GL function that calculates/retrieves the value of the calculated property.
  • Expression: Available if Kind is set to Expression. At runtime, the expression is added to the SELECT clause of the main query. In KB2924522 on the Infor Customer Portal, see the Programmer's Guide for details on what can be included in the SELECT clause of a query. You do not need to bind the value manually—this is handled automatically by the OData runtime.
  • DLL: Available if Kind is set to Function. Specify the DLL code that contains the function that calculates the value of the calculated property.
  • Function: Available if Kind is set to Function. Specify the function name that calculates the value of the calculated property. The 3GL function must meet these criteria:
    • It must return a long value: 0 means successful and any other value means an error. You can set error messages using dal.set.error.message()
    • It must have a single output (reference) argument of the domain specified in the Domain field. This argument must be assigned the value of the calculated property.
  • LnType: Indicates the basic type of the value that is returned by the function (available if Kind is set to Function). You can select an LnType from a list, which only shows values that are in accordance with the value of the Type field. For example, if you select the type Edm.String, only LnType String is available. But if you choose Edm.Duration, you can select Long and Double.
  • Input Fields: Select and specify the fields of the Entity Type's table that are used in the 3GL function to calculate the value of the calculated property (available if Kind is set to Function).
  • Collection: Select this if the value of the calculated property is an array.
  • Elements: Indicates the number of elements in the array (available if Collection is selected).
  • Domain: Specify the domain of the calculated value. If Kind is set to Expression, the domain is used when retrieving the value while fetching data from the table. If Kind is set to Function, the domain must match that of the function’s output argument.

Navigation Properties

Navigation properties represent relationships between entity types, similar to foreign keys in a database. They enable users to link different entity types. For example, a "Customer" has a navigation property to "Orders," allowing access to all orders for that specific customer.

Navigation properties include this data:

  • Name: The unique identifier for the navigation property within the entity type.
  • Type: The type of the target entity type.
  • Reference Type: The type of the navigation property.
    • Empty/Blank: Indicates that the entity referred to by the navigation property is present in the current company and the mapping between the fields of the referring entity and the referred-to entity does not require implementation via a DLL function.
    • Inter-Company: Indicates that the entity referred to by the navigation property is present in a different company.
    • Soft-Reference: Indicates that the entity referred to by the navigation property cannot be directly modeled in the LN OData Modeler and must be implemented via a DLL function. A soft reference is typically used when the 'from' and 'to' fields differ in number or type. For example, if the 'from' entity type has a property 'Session', while the 'to' entity type has individual properties for 'Package', 'Module', and 'Session', then the DLL function converts a single session code to the individual package, module, and session components.
  • Inter-Company: Identifies the entity property that contains the company number where the reference is present (applicable if the Reference Type is set to Inter-Company).
  • Soft-Reference DLL: The name of the dll (applicable if the Reference Type is set to Soft-Reference).
  • Soft-Reference Function: The name of the function within the dll (applicable if the Reference Type is set to Soft-Reference).
  • Nullable: Indicates whether the property can have a null value. If selected, the property can be blank. If cleared, it must always have a value.
  • Collection: Indicates whether the navigation property is a one-to-many relation.
  • ContainsTarget: Can be set to true or false, with the default being false. If set to true, the referenced entity or entities are considered part of the referring entity. These entities cannot exist independently of the containing entity. For example, order line entities are contained in an order header entity.
  • onDeleteAction: The action the service will perform on related entities when the entity for which the navigation property is defined is deleted.
    • Cascade: Deleting the source entity will also delete the related entities.
    • None: A DELETE request on a source entity with related entities will fail.
      Note: If no element is specified in onDeleteAction, the service's action cannot be predicted by the client and may vary for each entity.

The navigation properties' table grid shows additional information about the mapping columns. You can expand the grid by clicking the + symbol and collapse the grid by clicking the – symbol.

The grid includes this data:

  • Properties: Contains the name and binding of the source entity.
  • Referenced Property: Contains the name and binding of the target entity.
  • Constraint: Indicates that a referential constraint exists, ensuring that the value of the navigation property exists in the referred entity set.
Note: You can add a new row by clicking Actions > Add Row in the top right corner.

You can create a new navigation property by clicking the Add Navigation Property button, which will display a popup with these fields:

  • Name: The unique identifier for the navigation property within the entity type.
  • Entity Type: Select the target entity type.
  • Reference Type: Select the type of the navigation property (Empty/Blank, Inter-Company, or Soft-Reference).
  • Inter-Company: If the Reference Type is set to Inter-Company, specify the inter-company property.
  • DLL: If the Reference Type is set to Soft-Reference, specify the dll.
  • Function: If the Reference Type is set to Soft-Reference, specify the function within the dll.
  • Properties: Select the mapping columns from the source entity type.
  • Add: Click this button to create a navigation property.

Included Enum Types

Included enum types refer to enumerations that are used within an entity type to provide a set of named values. For details, see Enum Types.