I have some screens that I would like to reuse in different situations but the initial data is slightly different.
Let me try to explain with an example.
Lets say we have a system with Customers and Orders. There is a Browse and Edit screen for Orders so it is possible to view all the orders and create a new order. If you edit a Customer there is also a Fram that hosts the Order Browse Screen and then you should be able to create a new Order from within that customer and have the Customer link set automatically.
So in the situation with the embedded Order within the Edit screen I have the following.
Customer Edit Screen
A tab with a Frame that is setup to show the Order browse screen.
In this setup the Order Screen appears to have a WindowParam of ITEM set to be the Customer Entity. This seems to be done automatically so that is great. I grab this ITEM param and use if the set the setInitialValues of the Create Action in the Order Browse actions so that the new Order is linked to the current Customer.
Click Create and Save then all is super…The new order is created and linked to the current Customer.
Now I go to the main menu and open the Order Browse screen. This needs a tweak as the WindowParams do not include the automatic ITEM param. So I skip the setInitialValues of the Create Action. Click Create and no Customer is linked as I would expect.
The difference between the different ways of showing the Order Edit screen means I would like to show and hide the Customer lookup field as it isn’t needed when being set automatically.
Basically I’d like to know if this process seems logical to reuse a screen