Skip to content

mxcli check reads view entity columns from the model, not from the same script: a column added by CREATE OR MODIFY VIEW ENTITY is reported as a missing member in that script #1908

Description

@GlennCorvers

Description

When one script adds a column to an existing view entity and uses the new column (a microflow aggregate, a GRANT), check reports the member as missing: it reads the entity as stored in the model and ignores the modification earlier in the same script. References to objects created in a script are skipped; members of entities the script creates or modifies should be resolved against the script too. The script has to be split in two.

Steps to reproduce

Setup, applied first with mxcli exec -p <app>.mpr setup.mdl:

mdl 1;
CREATE PERSISTENT ENTITY MyFirstModule.ReproItem ( Dept: String(50), Amount: Integer );
CREATE OR MODIFY VIEW ENTITY MyFirstModule.ReproSummary ( Dept: String(50), ItemCount: Integer ) AS (
  select i.Dept as Dept, count(i.ID) as ItemCount from MyFirstModule.ReproItem as i group by i.Dept );

Script:

mdl 1;
CREATE OR MODIFY VIEW ENTITY MyFirstModule.ReproSummary (
  Dept: String(50), ItemCount: Integer, OpenCount: Integer
) AS (
  select i.Dept as Dept, count(i.ID) as ItemCount, sum(i.Amount) as OpenCount
  from MyFirstModule.ReproItem as i group by i.Dept );
CREATE MICROFLOW MyFirstModule.ReproSum () RETURNS Integer AS $Total
BEGIN
  RETRIEVE $Rows FROM MyFirstModule.ReproSummary;
  $Total = sum $Rows by OpenCount;
  RETURN $Total;
END;
mxcli check -p <app>.mpr script.mdl

Expected

Check passes: OpenCount is a column the script itself adds.

Actual

Reference errors:
  MyFirstModule.ReproSum: sum $Rows by OpenCount: MyFirstModule.ReproSummary has no member "OpenCount" — it has Dept, ItemCount — mxbuild reports this as CE1613 "The selected attribute 'MyFirstModule.ReproSummary.OpenCount' no longer exists"
✗ 1 reference error(s) found

exec refuses the whole script for the same reason. Splitting it into a script that changes the view entity and a script that uses it makes both pass.

Version

  • mxcli: v0.32.0 (2026-11-15T18:08:59Z) and nightly-20261119-32a67fa4a (2026-11-19T10:53:32Z): same result on both
  • Mendix version of the app: 11.12.4
  • OS: Windows 11

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