Changes the status and comment of a list of objects

I would like to achieve the following: On an overview of let's say 'Invoices', I would like to have an Invoke button that will allow me to change both the 'status' (enumerations) as well as the 'comments' (free text) of the Invoices. The best way to do this is probably to open a form that will allow me to change the status en fill in the comments. It needs to be possible to select more than one Invoice (i.e. the property 'multi-select' is set to 'true'), so the status and comments need to be copied to all Invoices that I selected before pressing the Invoke button. How would I realise this?
1 answers

Essentially what you're trying to do is to get some user input in a separate dialog, and then performing some action with this user input. This can be accomplished as follows.

First, create a metaobject "UserInput" that will hold your user input, in your case a status attribute and a comments attribute. Also create an association from your UserInput object to your Invoice object, so that it can refer to a number of Invoices (e.g., a reference set owned by the UserInput object).

Then, create a form with a data view on UserInput, which contains the fields that you want the user to enter, as well as "OK" and "Cancel" action triggers (buttons).

In the microflow for your grid invoke button, create a UserInput object and fill the reference to the Invoice object with the selection that is passed to the microflow. Then open the user input form with the UserInput object as parameter.

In the microflow for the "OK" button, use the reference from the passed UserInput object to the Invoice object to retrieve the selected Invoices, and update all status and comment fields. Also delete the UserInput object to clear up the database. Finally, close the form. In the "Cancel" microflow you only need to delete the UserInput object and close the form.

Hope this helps, let me know if any of this is unclear!