Skip to content

ORM, do not copy System members with (Clone, DeepClone, copyAttributes ...) #150

@maddam76

Description

@maddam76

Dear,

I found behaviour with function ORM:Clone and copyAttributes where System members are cloned/copied from the source to the target as well.
Example:
I have entity Quote with members Name and System member createdDate.

When in microflow use action Clone, the createdDate is clonned as well with the datetimestamp in the past and of course because it is System member it is not possible to change it in the microflow in the next steps.

But I expect every time new object is created/commited, this system member datetimestamp createdDate will correspond with actual datetimestamp, does not matter if it is cloned object, because it is always new object created.

Same behaviour is for function ORM:copyAttributes.

For this reason I cannot use function Clone or copyAttributes in microflow, because I need to know datetimestamp of object creation.
Maybe same situation will be with other System members, I did not test them.

Please think about if it is issue or not, if System members should be removed to be copied from Clone, copyAttributes, DeepClone or maybe other functions. Or set this behaviour as option, - e.g. same like option to copy associations for Clone function.

Awaiting your reply, best regards Marek

P.S. Maybe think alternatively about owner system member. User1 will create Object1. Later in the app User2 will do cloning function in Mendix of Object1. Is it correct, that User1 will be still owner of the new Object2, even this new object has been clonned by User2?

Image

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