Hi @lsw-fabian,
Thanks for the response. I appreciate it.
Is app.record_reload() going to refresh the whole form? I only need to load the list because it's not connected to the form.
Just to give you context:
- I have multiple stores, and each has their own set of products.
- I created a store relation and a product relation and connect the two.
- I also created a sales relation to store sales qty per product per store. I connected the store and product to this relation.
Problem:
- To save or add a sale, I need to select the store (to filter the product dropdown), select one product and add its qty, then hit save. This means, I need to do this one by one per product.
Requirement:
- I would love to have a form where I select the store, then it will load all of its products into a list. I can then double-click the product in the list and load a subform to add the qty. When I hit save, it will take all of the data in the list and save it to sales relation.
Initial Solution:
- I created a relation that will serve as a placeholder or like a temporary array variable. This relation is not connected or linked to any other relations. It's just a temporary storage, but it also contains store, product and qty. I've also created a form so that I can add qty via subform later.
- When I select the store in the sales form, I have front end and backend scripts that get the list of products from the product relation based on the selected store and insert the list of products to the placeholder relation. The user can now see the list of products for that store, and he/she can also double-click each product and add a qty in the subform.
- I'm also gonna create a script that gets triggered when they save. It will take the data from the place holder relation and store it to the sales relation.
- With this idea, we can save multiple products at the same time.
Roadblock:
- The roadblock is that every time I selected a new store, the list under the placeholder relation doesn't automatically refresh. Remember that it's not connected or linked to any relation or the sales form.
That's the situation. Let me know if there's a better way of approaching this problem. Thank you for your help.
Cheers,