{
  "id": 20324660,
  "title": "Uniface 10 field triggers - leaveField compiles, but loseFocus is what runs",
  "url": "https://urgent.news/2026/11/16/uniface-10-field-triggers-leavefield-compiles-but-losefocus-is-what",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-16T20:25:34.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/f345345dfg/uniface-10-field-triggers-leavefield-compiles-but-losefocus-is-what-runs-gep"
  },
  "original_language": "en",
  "account": "A customer app built in Uniface 10 featured an entry form that automatically tidied names, checked e-mail addresses, filled in cities from postal codes, and listed similar customers as the user moved from field to field. This functionality relied on field triggers, with the first version running smoothly despite the compiler's reluctance to accept the trigger name leaveField. Tested on Rocket Uniface 10.4.03 Community Edition (10.4.03.021) for Windows, the issue arose when the trigger failed to execute. After some investigation, it was discovered that Uniface 10 had renamed the interactive field triggers, with the one that fires when a cursor leaves a field now being called loseFocus. The original trigger, leaveField, was not among them, yet the compiler still accepted it, allowing it to appear in the compiled form but still not run. To ensure a trigger runs, it's essential to check its name first. In the case of the postal code field, the trigger was renamed to loseFocus, and the code within called various entry functions to validate and process the data. The issue of the tag field failing to show suggestions on double-click was also addressed, with the solution involving setting the DblClk property to Detail. It's crucial to note that field triggers are part of the XML export and not part of the component script, so tools that only inspect the component script may miss them. To avoid confusion, it's recommended to use the proper Uniface 10 trigger names: loseFocus, getFocus, validate, detail, and valueChanged.",
  "summary": "A customer app built in Uniface 10 got a quick entry form: while the user moves from field to field, the form tidies names, checks the e-mail address, fills in the city from the postal code and lists similar customers. All of that runs in field triggers. The first version did nothing at all, and the compiler did not complain. Tested with Rocket Uniface 10.4.03 Community Edition (10.4.03.021) on…",
  "key_points": [
    "Uniface 10 renamed interactive field triggers",
    "\"leaveField\" trigger replaced with \"loseFocus\"",
    "Proper trigger names crucial for Uniface 10 functionality"
  ],
  "editors_take": "The discrepancy between accepted compiler syntax and actual execution highlights how silent renaming of interactive field triggers can break automated data validation and form functionality in Uniface 10 applications.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}