IT tutorials
 
Applications Server
 

Microsoft Dynamic AX 2009 : Developing Web User Interface Components (part 1)

1/12/2013 5:49:34 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Enterprise Portal has a built-in set of ASP.NET controls you can use to access, display, and manipulate Dynamics AX data. It also includes APIs for programmatic access to data and metadata, a C# proxy class framework to access Dynamics AX business logic, and helper classes and a Visual Studio add-in for adding and importing files to and from the AOT. Figure 1 shows a sample Visual Studio project for Enterprise Portal development.

Figure 1. Enterprise Portal Visual Studio project

AxDataSource

Data sets you create in the AOT are exposed to ASP.NET through the AxDataSource control. AxDataSource abstracts the data store and the operations that can be performed on the data, from connecting to or reading/writing from the data store. You can associate ASP.NET data-bound user interface controls with AxDataSource through the DataSourceID property. Using this standard ASP.NET data binding, you can rapidly develop user interface logic without needing specific domain knowledge about how to connect to or access data from Dynamics AX. Because AxDataSource takes care of the data access from Dynamics AX, developers don’t have to worry about data access and can focus on the business aspect.

The data source control is simply a container for one or more uniquely named views (AxDataSourceView). All the logic is encapsulated in this DataSourceView-derived class. AxDataSourceView implements all the functionality to read and write data. The data-bound control can identify the set of enabled capabilities and display the right set of user interface controls and enable or disable them. You use the DataMember property of a data-bound control to select a particular view. AxDataSourceView maps to the data set view. So for each dynamic data set view based on the number of data sources and the type of join, you get an equivalent number of AxDataSourceView in the AxDataSource control to which any data-bound control can bind.

The data source control also supports filtering records within and across other data source controls and data source views. When you set the active record on the data source view within a data source control, all the child data source views are also filtered based on the active record. You can filter across data source controls through Record Context. In Record Context, one data source control acts as the provider of the context, and zero or more data source controls act as consumers. One data source can act as both provider and consumer. When the active record changes on the provider data source control, the record context is passed to other consuming data source controls, and they apply that filter as well. You use the Role and ProviderView properties of AxDataSource for this purpose. One Web User Control can contain any number of AxDataSource controls. Only one of them can have the property Role set to Provider. Any number of them can be set to Consumer.

You can use the DataSetViewRow object to access the rows in a DataSetView. The GetCurrent method returns the current row.

DataSetViewRow row = this.AxDataSource1.GetDataSourceView("View1").DataSetView.
GetCurrent();

					  


The GetDataSet method on AxDataSourceControl specifies the data set to bind. The DataSetRun property provides the run-time instance of the data set, and you can use AxaptaObjectAdapter to call the methods. So to invoke methods defined in data sets from a Web User Control, you would use the following code.

this.AxDataSource1.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("method1");

					  


AxGridView

The AxGridView control displays the values of a data source in a table format in which each column represents a field and each row represents a record. With AxGridView, you can select, sort, group, expand, filter, edit, and delete items. AxGridView extends the ASP.NET GridView control and lets you provide selection, grouping, expansion rows, filtering, context menus, and other enhanced capabilities within the Dynamics AX Enterprise Portal user interface.

AxGridView also includes built-in data modification capabilities. Using AxGridView with the declarative AxDataSource, you can easily configure and modify data without writing a single line of code. AxGridView also has many properties, methods, and events that you can easily customize with application-specific user interface logic.

You can find the full set of properties, methods, and events for GridView and AxGridView on MSDN. Listed here are some of the AxGridView properties you’ll likely use most often:

  • AllowDelete If enabled and if the user has delete permission on the selected record, AxGridView displays a Delete Selected Item button and allows the user to delete the row.

  • AllowEdit If enabled and if the user has update permission on the selected record, AxGridView displays Save and Cancel buttons on the selected row and allows the user to edit and save or cancel edits. When a row is selected, it automatically goes into edit mode, and edit controls are displayed for all columns for the selected record where the AllowEdit property for the column is set to true.

  • AllowGroupCollapse If grouping is enabled, this setting allows the user to collapse the grouping.

  • AllowGrouping If set to true, and a group field is specified, the rows are displayed in groups and sorted by group field. Page size is maintained, so one group might span multiple pages.

  • AllowSelection If set to true, the user can select a row.

  • ContextMenuName If ShowContextMenu is enabled, ContextMenuName defines the name of the Web menu in the AOT to be used as a context menu when the user right-clicks the row.

  • DisplayGroupFieldName Gets or sets a value that indicates whether the GroupFieldName is displayed in the group header text of a group view of a GridView control. The default is true.

  • GroupField Data field that is used to group GridView. This property is used only when AllowGrouping is set to true.

  • GroupFieldDisplayName Display name for the group field used in the display <GroupFieldDisplayName> : <GroupFieldValue>. If a name isn’t specified, by default the label of the GroupField renders in group view. This property is used only when AllowGrouping is set to true.

  • ShowContextMenu If set to true, displays the Web menu defined in the ContextMenuName property as the context menu when the user right-clicks the row.

  • ShowFilter If set to true, displays the filter control in AxGridView.

  • ExpansionColumnIndexesHidden A comma-separated list of integers, starting with 1, that represents which columns to hide from the expansion row.

  • ExpansionTooltip The tooltip displayed on the expansion row link.

  • ShowExpansion Specifies whether an expansion is available for each row in the grid. When set to true, the expansion row link is displayed for each row in the grid.

Figure 2 shows a sample list page with the filter control and context menu set.

Figure 2. Enterprise Portal list page with filter control and context menu

ContextMenu

The ContextMenu object also allows you to add menu items and separators at run time. It provides methods to remove menu items and resolve client or Enterprise Portal URLs. You can access the ContextMenu object from AxGridview.ContextMenu.

ActionMenuItemClicked, ActionMenuItemClicking, and SetMenuItemProperties are three ContextMenu events.

SelectedIndexChanged, DataBound, and Row* events are AxGridView events for which you commonly write code to specify actions to take when the selection is changed, to inspect and change styles when data is rendered, and to react when rows are modified, respectively.

 
Others
 
- SharePoint 2010 : Service Applications - Creating the Secure Store
- SharePoint 2010 : Service Applications - Managing a service
- System Center Configuration Manager 2007 : Proving the Concepts (part 2) - Testing in the POC Phase
- System Center Configuration Manager 2007 : Proving the Concepts (part 1) - Building the Proof of Concept Environment
- BizTalk Server 2009 : Administrative Tools (part 4) - MSBuild
- BizTalk Server 2009 : Administrative Tools (part 3) - ExplorerOM
- BizTalk Server 2009 : Administrative Tools (part 2) - WMI
- BizTalk Server 2009 : Administrative Tools (part 1) - BizTalk Administration Console, BTSTask
- Microsoft Dynamic GP 2010 : Understanding all of the financial information about an asset with Fixed Asset Details
- Microsoft Dynamic GP 2010 : Tracking Tangible Personal Property Tax information for Fixed Assets
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us