Thursday, October 06, 2016

AX2012 EP Multiselect list control

This blog is about creating a mulitselect option. To begin with the various steps involved in the process would be as follows

  1. Creating a drop down list with select option.
  2. Building a string based on the selections made in the list and displaying this list in a text control.
  3. Building the select list based on the text string in the linked text box, so that when the drop down is clicked these values are pre-selected in the list box.
This blog is a continuation from the previous blog entry

Step 1: Creating a drop down list
A drop down list would be populated from a table or view created in AX. Queries in portal are consumed using a dataset object in AOS, hence lets create a dataset in AOS.

Once a dataset object has been created in AOS the same should be consumed using a AxDataSet object on the toolbar. The AxDataset will be set to consume the dataset object created in AOS. Lets create a AxDataSource object and call it DatSourceWorkerInfo as shown below

A textbox along with a drop down list is created on the control. The drop down list will be added with events to populate the data and update the associated text box. Lets create a text field called txtEmpNo (readOnly) and a AxLookup control called axEmpNoLookup as shown below

The codebehind for the drop list (axEmpNoLookup) will be added for two events OnLookup and OnOkClicked as follows

                            OnOkClicked="worker_OkClicked" OnLookup="worker_OnLookup"
                            AllowMarking="True" AutoPostBack="True">

No comments: