Skip to content

check passes $Var/<member> for a member the entity does not have, incl. the system id (mx check CE0117; check/exec pass) #1650

Open

Description

@MohamedElNady

mxcli v0.28.0 (2026-10-23) · Mendix 11.14.0 (blank repro project) — first hit in an 11.15.0 app · OS Windows Server 2025

Summary

mxcli check (with --references, and with the catalog-based expression type pass reporting "Expression types OK") accepts a microflow expression that reads a member which does not exist on the entity. exec writes it; mx check then reports CE0117. Two shapes:

  • the system member id — toString($Obj/id) or $A/id = $B/id. In Studio Pro an object's id is not readable in an expression at all; this is the shape a script author is most likely to write (to build an audit key, a correlation id, …);
  • any misspelled attribute — toString($User/Bogus) on an entity that already exists in the model.

Related: #580 (open, expression type checking) and #1515 (open, expressions the build rejects — function arguments, Decimal toString, backslashes). Neither covers member resolution on $Var/<member>.

Minimal repro

create module ModI;
create microflow ModI.MF_UserIdText ($User: System.User) returns String as $r
begin
  declare $r String = toString($User/id);
  return $r;
end;

Expected

check reports the unknown member (an error, or at least a warning), the way the type pass already reports a type mismatch. For id specifically, a hint such as "an object's id is not readable in an expression — use CommunityCommons.getGUID(item = $Obj) or compare the objects themselves ($A = $B)".

Actual

$ mxcli check <repro>/scripts/ewo_id4.mdl -p Repro.mpr --references
✓ Syntax OK (2 statements)
✓ All references valid
✓ Expression types OK, no unstated member drops, no flow change exec would refuse, no used flow left without access, no entity-access call mismatch
Check passed!

$ mxcli exec <repro>/scripts/ewo_id4.mdl -p Repro.mpr
Created module: ModI
Created microflow: ModI.MF_UserIdText

$ mx check Repro.mpr
[error] [CE0117] "Error(s) in expression." at Create variable activity 'Create String variable'
The app contains: 1 errors.

What narrows it down

Variant check mx check
toString($Item/id), entity created in the same script passes CE0117
$Item/id = $Other/id (Boolean), entity created in the same script passes CE0117
toString($User/id), System.User (already in the model) passes, type pass "OK" CE0117
toString($User/Bogus), System.User (already in the model) passes, type pass "OK" CE0117

The rows with an entity created in the script are expected to be skipped by --references ("References to objects created within the script are skipped"); the System.User rows are the bug — the member is resolvable against the catalog and is not checked.

Suggestion

Resolve $Var/<segment> against the variable's entity (and its generalizations) in the expression type pass; refuse a segment that is neither an attribute nor an association; special-case id with the hint above.

Workaround we use

CommunityCommons.getGUID(item = $Obj) (returns Long) and toString() of that; object comparison ($A = $B) instead of comparing ids.

Session log (isolated HOME, repro project only; local paths replaced by <repro>)
{"level":"INFO","msg":"session_start","version":"v0.28.0","go":"go1.27.3","os":"windows","arch":"amd64","mode":"mxcli check","args":["mxcli.exe","check","<repro>/scripts/ewo_id4.mdl","-p","Repro.mpr","--references"]}
{"level":"INFO","msg":"connect","mpr_path":"Repro.mpr","mendix_version":"11.14.0","mpr_format":2}
{"level":"INFO","msg":"execute","stmt_type":"ConnectStmt","stmt_summary":"connect local 'Repro.mpr'","duration_ms":1}
{"level":"INFO","msg":"session_end","commands_executed":1,"errors_count":0,"duration_s":2}
{"level":"INFO","msg":"session_start","version":"v0.28.0","go":"go1.27.3","os":"windows","arch":"amd64","mode":"mxcli exec","args":["mxcli.exe","exec","<repro>/scripts/ewo_id4.mdl","-p","Repro.mpr"]}
{"level":"INFO","msg":"connect","mpr_path":"Repro.mpr","mendix_version":"11.14.0","mpr_format":2}
{"level":"INFO","msg":"execute","stmt_type":"CreateModuleStmt","stmt_summary":"create module ModI","duration_ms":126}
{"level":"INFO","msg":"execute","stmt_type":"CreateMicroflowStmt","stmt_summary":"create microflow ModI.MF_UserIdText","duration_ms":71}
{"level":"INFO","msg":"session_end","commands_executed":3,"errors_count":0,"duration_s":0}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions