One challenge when creating an application or an extension to an application is making it easy for a new user to use and for existing users to learn new tasks. Compiere's Application Dictionary is a powerful tool as it is the engine that dynamically creates your user interface.
The functionality available in the Application Dictionary allows you to create these types of applications with very little additional effort. The main features are found in Elements, Context, Table and Column and Window, Tab and Field.
Elements
In Compiere, each field on a table (and subsequently a window) references an Element. The Elements allow you to centrally maintain field names, bubble help and online help. For each Element the Name is used for the field label in the window, the text entered in the Description field is used for bubble help, the text entered in the Comment field is used to generate the online help. Therefore when you create new Elements, if you have also entered values in the Description and Comment you automatically get help.
Context
There may be instances where for a given window you want a different field label or help. This can be accomplished in two ways. One way is to define a Context (e.g. Sales). In Context you define the new names/labels to use. Then you assign the Context to the Window. This method is best if there are multiple windows that will use the same Context. A good example of this is in the Sales windows (Sales Order, Shipment and Customer Invoice) where you want the Business Partner field to display as Customer.
The second way is in the Field entity in Window Tab and Field, change the Name, Description and/or Comment and then deselect the Centrally Maintained flag. This will prevent the system from synchronizing the terminology from the element to the window.
Another common customization is to display fields under specific conditions and hide them in other conditions. This can be accomplished by using the Display Logic in the Field entity of Window, Tab & Field. An example of this can be seen in the Sales Order window where the Rate Type field only displays if the currency of the price list is not the primary accounting schema currency.
Perhaps there are fields on a window that you do no want to display at all. In Window Tab and Field open the desired field and select the displayed checkbox. There are a few considerations if you do this however. If the field is required, make sure there is a default value. When you choose not to display a field, the screen layout may be compromised so you may have to make other adjustments.
Sometimes there are fields that users should see but you do not want them to be able to update them. This is a common requirement in Sales Orders where users can see the price list but they should not be able to change it. There are two ways to accomplish this. One is in Window Tab and Field select the Read Only checkbox. If you have some users who should be able to update the price list and other who should not you would then need to create a copy of the Sales Order window, one with the checkbox selected and the other not selected and allow access to the appropriate window to each user.
The second way is to use the Read Only in Table & Column. For the given column (in this example M_PriceList enter the following in the Read Only logic field #@AD_Role_ID@=102 | #@AD_Role_ID@=222
. This will check the role that the user logged in with and if the ID is one of the values selected, the field will allow updates and if not it will be read only.
These are just a few ways you can use the Application Dictionary to create an application that best suites your needs. Just remember, if you change any entities that are defined as Compiere or Dictionary make sure you select the customization flag in Change Audit so your changes are preserved during migration.