dbxapp Knowledge Build a dbxForm in One Pass

Build a dbxForm in One Pass

Developer · Quick Start

This quick start takes you from the Data Definition (DD) and Field Definition (FD) contract to verified persistence. The full reference remains available for advanced cases.

When dbxForm fits

  • Create or edit records
  • Validated filter and configuration masks
  • Multi-level or AJAX updated forms

The mandatory procedure

  1. Define the Data Definition (DD) and the language-specific Field Definition (FD).
  2. Initialize dbxForm, then set the data, record ID (RID) and action.
  3. Add all fields before checking whether the form was submitted.
  4. Evaluate submit() and errors().
  5. Persist through save_post() and always render through run().
$form = dbx()->get_system_obj('dbxForm');
$form->init('customer-edit', 'customer-edit');
$form->_dd = 'crm|customer';
$form->_fd = 'crm|customer-form';
$form->_data = $data;
$form->_rid = $rid;
$form->add_flds();

if ($form->submit() && !$form->errors()) {
    $form->save_post($form->_dd, $rid ?: 'new');
}

return $form->run();

Verification and acceptance

Verify required fields, invalid input, duplicate submissions, record creation and updates, permissions, and the Ajax partial reload before acceptance.

All variants and contractsCallbacks, field types, state, uploads and extended patterns. Open the full reference