I have an administrative staff, account manager and customer. The administrative staff creates a new customer. After this, the administrative staff selects an account manager for the customer. Based on an attribute of the current user (administrative staff) also a list of products should be added to this customer. For example administrative staff with attribute toys-steel has another list of products as administrative staff with toys-wood. The administrative staff creates this list in a datagrid. This whole proces should be done automatically in a microflow but I'm stuck on the part of adding this list of products to the customer. If the account manager choose in his account this customer he should also be able to see this list - how? The domain model consists of administrative staff, account manager, customer and product list. -Edit- Next problem: I created the list as mentioned. But if an accountmanager changes the value of an attribute for this customers this value is changed for all the customers. How to make this list unique for this customer?
It's difficult to answer your question without full context. But here are some thoughts:
- You'll need an association between Customer and Products. It should be many to many with the association drawn from the customer to the product
- You mention assignment of an account manager, but then say that the products are assigned based on the current user. Please be sure the you are indeed using the correct of these two to make assignment
- If the above are correct, it should be as easy creating a microflow where you retrieve a list of products assigned to the current user, then change the customer. The change should be something like this:
the next question you will have is whether or not you need to refresh and/or commit to the database. We'd also need to know more to make that decision.