MX-Frame Library Send comments on this topic.
Creating Constraint
MX-Developer > Data Access Layer - MxAdapter > Designing Data Source > Schema > Designing a Field > Constraints > Creating Constraint

Glossary Item Box

Creating a Constraint

User requirements specify that an end date must be later than the start date.

Example (MxSpace)

To see the implementation of a constraint in MxSpace application click Production -> Manage. Try to create new work order. Fill all fields with appropriate values. Enter value in Start field. Enter older value in End field than the value in Start field. Confirm the insert. A warning is displayed: “End date must be later than the start date.”

To create a constraint on a field

  1. Open appropriate adapter (WorkOrderAdapter) in Solution Explorer.
  2. Expand the desired field (EndDate) in the appropriate data source schema (WorkOrder).
  3. Select Constraint node.
  4. Click Add button in the toolbar and select Expression Constraint.
  5. In property Expression enter [DataSources.WorkOrder.EndDate] > [DataSources.WorkOrder.StartDate]. Expression can also be created by using Variables -> DataSources ->WorkOrder and then selecting appropriate fields.
  6. In property Text enter 'End date must be later than the start date.'. *

* When writing text in the Expression Designer be sure to use single quotes.

©2009 Metronik. All Rights Reserved.