Understanding #EFLD in Omnis Classic
A powerful and underused feature for generic field handling in Omnis 7 / Omnis Classic.
What is #EFLD?
#EFLD is a read-only field reference variable in Omnis Classic that holds a reference to the current data entry field. It is equivalent to Fld(#EN) but is more efficient.
- Type: Field reference (not a string)
- Set during: Field procedures and data entry
- Use case: Access or modify the contents of the currently active field, without knowing its name
How is #EFLD Different from #EN?
| Feature | #EN | #EFLD |
|---|---|---|
| Type | String (field name) | Field reference (object) |
| Usage | Identification | Direct access to field contents |
| Equivalent | n/a | Fld(#EN) (but more efficient) |
| When Useful | General field tracking | Generic or high-performance logic |
Examples
1. Modify current field value
Calculate #EFLD as "Default value"
2. Set the current list based on the list field in focus (safe version)
If type(#EFLD) = kList
Set current list #EFLD
End If
3. Conditional logic based on user input
If #AFTER & (dat(#EFLD) = #D)
OK message {User has entered today's date}
End If
Notes
- Works in field-level procedures or library control procedures
- Great for generic validation, auto-fill, or field change tracking
- Does not work outside a field context (e.g., menu or timer events)
Summary
If you’re writing reusable procedures or need to track what the user is doing without hardcoding field names, #EFLD is the safest and cleanest way to interact with the current field object in Omnis Classic.
Pro tip: It’s obscure, but officially documented in older Omnis 7 manuals — it’s not a myth!