As described in Designing a Layout Control, the sample application's Rental Agreements Layout Control enables and disables fields on the Rental Agreements form to provide users with a visual indicator of the current phase of a Rental Agreement and what fields are currently available for editing.
The sample application defines three phases for a Rental Agreement:
The validation to enforce a Rental Agreement's phase is defined in the Rental Agreements Entity Object. However, without the Layout Control, all fields on a Rental Agreements record would appear enabled regardless of the current phase of the rental agreement (as shown below). In this case, a user would not be notified of any validation errors until he or she attempts to save the record.
With the layout control linked to the Rental Agreements form, the set of available fields update automatically depending on the current phase of the Rental Agreement.
During a vehicle check-out, only the Check-Out fields are enabled on the new Rental Agreements record. Check-In fields are disabled, as shown below.
While a vehicle is checked out, only the Check-In fields are enabled on the Rental Agreements record (so the vehicle can be checked back in when returned). Check-Out fields are disabled, as shown below.
While a vehicle has been returned and checked in, the details of the Rental Agreement can no longer be modified so all Check-In and Check-Out fields are disabled, as shown below.