Creating New Window.
Creating a New Window (Simple Approach)
Here are more quicker steps in Creating a New Window which may be useful for the adempiere beginner and to those who are inexperienced with database scripts or programing languages. For a more elaborate detailing including extending the Window functionality, please refer to NewWindow.
1.Access into Adempiere as System Administrator
2.Open Module "Table and Column"
- Create new table
- Create new column
- Synchronize table with database
Make sure all mandatory fields also included in that table (ad_client_id, ad_org_id, created, createdby, updated, updatedby, isactive)
ad_client_id numeric(10) NOT NULL, ad_org_id numeric(10) NOT NULL, isactive character(1) NOT NULL DEFAULT 'Y'::bpchar, created timestamp without time zone NOT NULL DEFAULT now(), createdby numeric(10) NOT NULL, updated timestamp without time zone NOT NULL DEFAULT now(), updatedby numeric(10) NOT NULL
These mandatory fields are not created automatically when synchronizing table with database.
3.Open Module "Window, Tab and Field"
- Create new Window
- Set Data access level="All"
- Create tab and copy field from table
- Set table=Table name that just created
- Press "Copy Field" button
- Rearrange the field position
4.Open Module "Menu"
- Create new Menu
- Choose Action="Window"
- Select the new window from the pull down list
5.Relogin into System to view your new window.
The table can be created previously on your database. But this is not needed, ADempiere can create the table with the button "Synchronize Column" in Column tab.
You can use the follow template SQL script to create the table:
CREATE TABLE table_for_test ( table_for_test_id numeric(10) NOT NULL, -- start: mandatory fields ad_client_id numeric(10) NOT NULL, ad_org_id numeric(10) NOT NULL, isactive char DEFAULT 'Y' NOT NULL, created timestamp(20) DEFAULT now() NOT NULL, createdby numeric(10) NOT NULL, updated timestamp(20) DEFAULT now() NOT NULL, updatedby numeric(10) NOT NULL, -- end info varchar(20), PRIMARY KEY (table_for_test_id) );
One thing to emphasize is that the name of the primary key HAS to be <table_name>_id.