Skip to content

Commit a758d86

Browse files
akoclaude
andcommitted
docs: fix mdl-entities CreatedDate example and improve MDL020 suggestion
mdl-entities.md used `CreatedDate: datetime` in two examples, which triggers lint error MDL020 (system attribute name conflict). Changed to `CreatedDate: autocreateddate` with an explanatory comment. MDL020 suggestion now explains both options: - use the pseudo-type (autocreateddate) for the Mendix built-in field - choose a different name (e.g. EntryDate) for an unrelated date field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e3792fc commit a758d86

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.claude/skills/mendix/mdl-entities.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ create persistent entity Module.Customer (
3030
IsActive: boolean default true,
3131
3232
-- Date/Time
33-
CreatedDate: datetime,
3433
BirthDate: date,
34+
-- Use autocreateddate (not datetime) to record when the object was created.
35+
-- 'CreatedDate' as a plain datetime triggers lint error MDL020.
36+
CreatedDate: autocreateddate,
3537
3638
-- Enumeration
3739
status: Module.CustomerStatus default Active,
@@ -255,7 +257,7 @@ create persistent entity Shop.Customer (
255257
Email: string(200) not null unique,
256258
Phone: string(20),
257259
IsActive: boolean default true,
258-
CreatedDate: datetime
260+
CreatedDate: autocreateddate
259261
);
260262
/
261263

mdl/executor/cmd_enumerations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func ValidateEntity(stmt *ast.CreateEntityStmt) []linter.Violation {
323323
DocumentType: "entity",
324324
DocumentName: stmt.Name.String(),
325325
},
326-
Suggestion: fmt.Sprintf("Rename to avoid conflicts (e.g., 'Custom%s')", attr.Name),
326+
Suggestion: fmt.Sprintf("To use the Mendix built-in audit field, declare it with the pseudo-type: '%s: Auto%s'. To store an unrelated date, choose a different name (e.g., 'EntryDate', 'RecordDate')", attr.Name, attr.Name),
327327
})
328328
}
329329
}

0 commit comments

Comments
 (0)