I am working on an inventory system where computers and other devices are assigned to employees. I want to have a history field that keeps track of which employees a given device has been assigned to. More specifically, whenever I reassign a computer from one employee to another I want the history field to say “Reassigned to Employee A from Employee B by User A on MM/DD/YY.” Right now on the edit computer page I have the reference selector that selects Employee set to call a microflow when the reference selector value is changed using the “on change” event. The microflow has the following logic to edit the computer history. $Computer/History + ' Reassigned to ' + $Computer/Inventory.Computers_Employees/Inventory.Employees/FirstName + ' ' + $Computer/Inventory.Computers_Employees/Inventory.Employees/LastName + ' by ' + $user + ' on ' + formatDate([%CurrentDateTime%]) + '.' This only puts the new employee’s name in the history field, but doesn’t tell us where the computer came from. How can I change the microflow so also records which employee the device is coming from? Is this information lost as soon as I change the value selected in the reference selector? I am using version 8.18.1 of Mendix Studio Pro
You need to have an extra history entity to save the history. Associate a list of history objects with your main object. Each history object can have an assigned and an unassigned date as well as an association pointing to the assignee. Depending on your needs, you may want to have two associations (old assignee and new assignee) or you can recreate this information out of the assignee history.