Mendix Object Cloning – Technical points for Issue Solving
Issue with Standard Clone Object Action
The standard Clone Object
Java action copies all attributes, including system-managed ones like createdDate
and modifiedDate
.
These attributes are read-only in Mendix UI and cannot be overwritten via microflows after cloning.
Result: cloned objects retain the original creation timestamp, causing sorting and logic conflicts.
Deep Clone Action Usage
The Deep Clone Java action clones the object and its related entities recursively.
It requires specifying which attributes and relations to keep explicitly—no option for “clone all” by default.
This reduces issues with system attributes since you can exclude them.
Manual Specification Drawbacks
For objects with many attributes/relations, listing all members manually is time-consuming and error-prone.
Missing members in the Deep Clone config can lead to incomplete clones or bugs.
Possible Workarounds
Automate member listing: Use Mendix Model SDK or domain model export to generate a full list of attributes and associations for cloning config.
Custom clone logic: Implement a Java action or microflow that programmatically copies all attribute values except system-managed ones and resets the createdDate
.
Use a custom date attribute (e.g., CustomCreatedDate
) to track creation timestamps you control, avoiding reliance on system-managed createdDate
.
Resetting createdDate
Although createdDate
is system-managed, advanced techniques (like Java actions with full domain object access) can reset it.
This is not recommended due to side effects and maintainability concerns.
References and Resources
Mendix Forum thread on cloning issues:https://community.mendix.com/link/questions-about-clone-object-action/
Deep Clone Java action documentation and download:https://marketplace.mendix.com/link/component/276/
Mendix Model SDK (for automation): https://docs.mendix.com/howto/developer-tools/mendix-model-sdk
The most robust and future-proof solution is to manually copy all attributes and relations in a microflow. This is a pain once, but then you’re done and have full control.
I would recommend trying this.