The main point is that a Combo Box does not select an item based only on a matching text or code value. It usually selects based on the actual object reference (association).
So if your Employee entity only stores a code attribute, but your Combo Box is showing values from the Designationentity, Mendix does not automatically know which Designation object should be selected. It only knows the employee has a code string or integer. It does not yet have the related Designation object.
That is why, in edit mode, you may correctly retrieve the employee code from OQL, but the Combo Box still does not show the expected abbreviation.
The cleanest Mendix way is to use an association between Employee and Designation.
For example:
With this setup, when the page opens in edit mode, Mendix checks the associated Designation object and automatically shows its abbreviation in the Combo Box.
So the recommended setup is:
Your Combo Box should not be linked to the employee code attribute directly.
Instead, it should be linked to the association from Employee to Designation.
Then:
If your current data model only stores the code in Employee and you cannot change that structure, then you need an extra step before showing the edit page.
In that case, when you retrieve the employee record, do this in a microflow:
This way, even if the database originally stores only the code, the page will still have the correct associated Designationobject, and the Combo Box can display the abbreviation correctly.
So in practice, the issue is not really with the Combo Box itself. The issue is that the Combo Box needs the related object, while your current logic only provides the code value.
If you want to keep the current model as-is, a helper step in a microflow is needed.
If you want the most maintainable solution, use an association and let the Combo Box work with the Designation object directly.
If this resolves your issue, please mark it as accepted.
Dear Amisha,
I understand that you need to display the abbreviation in the dropdown. Most likely, your data in the Combo Box is coming from an association. In your Designation entity, you have both Code and Abbreviation.
Since you are retrieving the Employee using OQL, you already have the Code from the employee record. In the Selectable Objects Microflow, you should filter the records by matching the Employee Code with the Designation Code using XPath, and then return the corresponding Designation list.
In the Combo Box configuration, set the caption attribute to Abbreviation. This will ensure that the abbreviation is displayed in the dropdown.