Basics of a form in D365 FO


Methods:
 System generated methods, also known as system methods, standard methods or object methods, attached to the form are used to control the startup and shut down of the form. These events are frequently overridden to make initialization of the form. By default, the system methods are not displayed. To override a system method, right-click on the Methods node, select Override Method and then select the methods to override. 
 
Data Sources:
Data source(s) define the interface between the form and the database. An entry is added for each table. Adding a data source to a form allows the form to display the data from the table specified on the data source. The properties of the individual data sources determine the relationship between the data sources. Forms can contain any number of data sources, and each data source can be joined to another data source.
Design:
The design of the form defines the interface between the form and the user and controls the layout and presentation of the data. The design consists of components called controls. Some controls are used to edit and display data, while others are used to control the layout of the form.

The form consists of different patterns. These patterns provide form structure, based on a particular style (including required and optional controls), and also provide many default control properties

Example:
1.      Choose to add a new item to the project.
2.      Select User Interface from the left-hand pane.  
3.      Select Form from the right-hand pane. 

There are different patterns applied on forms so we work accordingly.

a.     Parameter Form/ Table of content:

Used when more data sources are used for setup configuration for example a module, for example parameters for a module. This pattern should be used when two or more logically related forms are required for setup configuration.

1.      Create a parameter table called VehiclePararameters with proper properties, Drag the VehicleParameters table from the project onto the Data Sources node in the top-left pane of form designer.

2.      Name the form as per the table's name; in this case, VehicleParameters.

3.      We don't want the user to be able to delete and create records, so change the following properties to No: Allow Create, Allow Delete, Insert At End, Insert If Empty.

4.      The form designer is broken into three areas: The Form pane, Design pane, and Preview/Pattern conformance pane.

5.      The Design node states that a pattern is not specified, which we must do. To apply the main form pattern, right-click on the Design node and choose Apply Pattern | Table of Contents.

6.      The lower pane changes to the Pattern tab and shows the pattern's required structure, as shown in the following screenshot:

7.      We will refer to each node in the pattern structure as a pattern element and, to aid ease of design, name the controls based on the pattern element's name.

8.      This enables us to add a Tab control, so right-click on the Design node and choose New | Tab.

9.      The error is removed from the Pattern pane, but shows that we have no tab pages within the TOC Tabs (Tab) pattern element.

10.      First, rename the new control to ParameterTab, and then add a new Tab Page by right-clicking on it in the Design pane and selecting New Tab Page.

11.      The first tab is usually a general settings tab, so name this new control GeneralTabPage.

12.      Find a suitable label for General and enter that into the Label property.

13.      As we alter the design, the designer will continually check that we are conforming to the pattern. It has found the following issues with the tab page control.

14.      We must add two Group controls, one for title fields that provide help to the user, and the other for the fields we wish to show in this page.

15.      Right-click on the GeneralTabPage control and select New | Group.

16.      Rename the new group control to GeneralTitleGroup.

17.      The pattern conformance pane shows we must have a StaticText control for the main title, and 0 or 1 StaticText controls for a secondary title. Right-click on GeneralTitleGroup and choose New | Static Text.

18.      Rename the new StaticText control to GeneralTitleText.

19.      Create a new label for the text General parameters and enter the ID into the Text property.

20.      Reselect the GeneralTitleGroup control and check if the pattern errors are gone.

21.      Reselect GeneralTabPage, as we now have one pattern error for a missing group. Add a new Group control.

22.      The new group control knows that it must also have a pattern applied, indicated by the Pattern: text after the control's name. Right-click on the control and choose Apply Pattern | Fields and Field Groups.

23.  Rename the control to GeneralFields.

24.  On the form pane, expand Data Sources, ConWHSVehicleParameters, and then Field Groups.

            25. Drag the field group, Defaults, onto the GeneralFields control in the design pane 

Other examples of parameter form are:

Example: CustParameters:











Comments

Popular posts from this blog

Batch jobs stuck on WAITING status in AX 2012

Electronic Reporting For Beginners

Computed column and virtual field in D365