
On the MOM tab, we have the Chairperson
field where we are entering the username. Similarly, we have the participant's name on the Participants
tab and the Actioned By person name on the Discussion Detail
tab. ADempiere maintains User/Contact detail. To provide a better finishing of our MOM window, it would be good if we can connect these fields with ADempiere's User/Contact so that a user can find the right User/Contact and assign them to a MOM. This way, all these fields need to be made like a search widget where a Search button appears next to these fields. When a user clicks on the Search button, he/she will be able to find the User/Contact, and upon selection, the selected User/Contact will appear in the field. As part of this recipe, we will follow through the steps required to convert each of these fields into a search widget.
Drop the adempiere.c_mom_participantsline
table by executing the following SQL:
DROP TABLE adempiere.c_mom_participantsline;
Delete the Fields, Tabs, Window, Columns, and Table entries for the c_mom_participantsline
table.
- Create the
adempiere.c_mom_participantsline
table by executing the following SQL:CREATE TABLE adempiere.c_mom_participantsline ( c_mom_participantsline_id numeric(10,0) NOT NULL, c_mom_id numeric(10,0) NOT NULL, ad_client_id numeric(10,0) NOT NULL, ad_org_id numeric(10,0) NOT NULL, created timestamp without time zone DEFAULT now() NOT NULL, createdby numeric(10,0) NOT NULL, updated timestamp without time zone DEFAULT now() NOT NULL, updatedby numeric(10,0) NOT NULL, ad_user_id numeric(10), company character varying(80) NOT NULL, CONSTRAINT cmom_cparticipantsline FOREIGN KEY (c_mom_id) REFERENCES adempiere.c_mom (c_mom_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED, CONSTRAINT cmom_aduser FOREIGN KEY (ad_user_id) REFERENCES adempiere.ad_user (ad_user_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED );
- Here, I have removed the participant column and added the ad_user_id column, which has a foreign key relationship with the adempiere.ad_user table.
- Log in as System/System with the System Administrator role.
- Go to the Window Tab & Field window and look at the detail of the Minutes Of Meeting window.
- Select the Participants tab on the Tab tab and go to the Field tab.
- Remove the Participant field from the list.
- Go to the Table and Column window and go to the
c_mom_participantsline
table entry, as shown in the following screenshot: - Click on the Create Columns from DB button. This will create the new column AD_User_ID, as shown in the following screenshot:
- Verify that there is no data in the
c_mom_participantsline
table and that the Participant column is not referenced elsewhere and also remove Participant from the Column list. - Select the AD_User_ID column and specify the following values for the two important fields, which are more relevant in this context (search widget):
- Reference: Select Search
- Reference Key: Select AD_User
- Go to the Window, Tab, and Field window and look at the details of the Minutes Of Meeting window.
- Select the Participants tab on the Tab tab and view its details in single row view. You will see the Create Fields button, as shown in the following screenshot:
- Click on Create Fields button so that the newly added User/Contact column is added as a field.
- Change the sequence of the User/Contact field such that it comes before Company.
- Log out and log in as GardenAdmin/GardenAdmin with the GardenWorld Admin role.
- Go to the Minutes Of Meeting window and go to the Participants tab. You will notice that the User/Contact field is populated, by default, with the current logged in username and a search button appears next to the field, as shown in the following screenshot:
- Click on the search button. This will pop-up the Info User/Contact window and will allow you to search and select the intended user, as shown in the following screenshot:
- Click on the tick button. You will see the selected user appearing in the User/Contact field. So, the Participants tab will look more connected with ADempiere, as shown in the following screenshot:
- Make similar changes to the Chairperson field on the MOM tab, and the Chairperson field appears as a search field, as shown in the following screenshot:
- Similarly, make changes to the Actioned By field on the Discussion Detail tab, and the Actioned By field appears as a search field, as shown in the following screenshot:

Here is the final schema:
CREATE TABLE adempiere.c_mom ( c_mom_id numeric(10,0) NOT NULL, ad_client_id numeric(10,0) NOT NULL, ad_org_id numeric(10,0) NOT NULL, isactive character(1) DEFAULT 'Y'::bpchar NOT NULL, created timestamp without time zone DEFAULT now() NOT NULL, createdby numeric(10,0) NOT NULL, updated timestamp without time zone DEFAULT now() NOT NULL, updatedby numeric(10,0) NOT NULL, value character varying(30) NOT NULL, name character varying(255) NOT NULL, start_date date NOT NULL, start_time timestamp without time zone NOT NULL, end_time timestamp without time zone NOT NULL, ad_user_id numeric(10), agenda character varying(4000), CONSTRAINT c_mom_pkey PRIMARY KEY (c_mom_id), CONSTRAINT cmom_aduser FOREIGN KEY (ad_user_id) REFERENCES adempiere.ad_user (ad_user_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED ); CREATE TABLE adempiere.c_mom_discussionline ( c_mom_discussionline_id numeric(10,0) NOT NULL, c_mom_id numeric(10,0) NOT NULL, ad_client_id numeric(10,0) NOT NULL, ad_org_id numeric(10,0) NOT NULL, isactive character(1) DEFAULT 'Y'::bpchar NOT NULL, created timestamp without time zone DEFAULT now() NOT NULL, createdby numeric(10,0) NOT NULL, updated timestamp without time zone DEFAULT now() NOT NULL, updatedby numeric(10,0) NOT NULL, item_nbr numeric (10,0) NOT NULL, discussion_desc character varying(2000), ad_user_id numeric(10), status character varying(80), CONSTRAINT cmom_cdiscussionline FOREIGN KEY (c_mom_id) REFERENCES adempiere.c_mom (c_mom_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED, CONSTRAINT cmomdl_aduser FOREIGN KEY (ad_user_id) REFERENCES adempiere.ad_user (ad_user_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED ); CREATE TABLE adempiere.c_mom_participantsline ( c_mom_participantsline_id numeric(10,0) NOT NULL, c_mom_id numeric(10,0) NOT NULL, ad_client_id numeric(10,0) NOT NULL, ad_org_id numeric(10,0) NOT NULL, created timestamp without time zone DEFAULT now() NOT NULL, createdby numeric(10,0) NOT NULL, updated timestamp without time zone DEFAULT now() NOT NULL, updatedby numeric(10,0) NOT NULL, ad_user_id numeric(10), company character varying(80) NOT NULL, CONSTRAINT cmom_cparticipantslinemom FOREIGN KEY (c_mom_id) REFERENCES adempiere.c_mom (c_mom_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED, CONSTRAINT cmom_aduser FOREIGN KEY (ad_user_id) REFERENCES adempiere.ad_user (ad_user_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED );
In this recipe, we replaced the free text user columns in the c_mom_participantsline
and c_mom_discussionline
tables with ad_user_id
, which is having a foreign key reference to the AD_User
table. The AD_User
table contains the ADempiere user detail. This is not a mandatory step. However, from a good database design perspective, it is advisable that we save the ID of an entity, which is referred to in a table and also has the constraint (foreign key) in place.
In step 9, we had to set the Reference to Search and Reference Key to AD_User for the User/Contact field on the Participants tab, Actioned By on the Discussion Detail tab, and Chairperson on the MOM tab. ADempiere interprets the Reference—Search—and displays a search button ( ) next to the field. By clicking on it, ADempiere takes care of showing the Info User/Contact pop-up to allow the user to search for a user and select a user from the search result.