Example: Create a Report with a Group Check Box

Important

This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.

Applies To: Microsoft Dynamics AX 2012 R3

The following example provides information about how the BOMPartOf report was converted to use the current report programming model. This report provides an example of a report that requires a group check box in the UI.

Example: BOMPartOf

  • The BOMPartOf report was migrated to the current report programming model.

  • An RDP contract was created.

  • The UI builder was used together with overrides so that the UI includes a group check box.

Before the conversion, the helper class did the following:

  • Add the fields to the dialog box.

  • Get the fields from the dialog box.

  • Set the report parameters.

  • Provide the grouping.

Implementation

To see the full implementation, in the development workspace, click AOT > Classes > BOMPartOfUIBuilder. The following code illustrates how to create a form group control, and how to use the control in the build method, the getFromDialog method, and the getSearchIntervalFromDialog method.

public void build() 
{ 
    FormBuildGroupControl formBuildGroupControl; 
    super(); 
    formBuildGroupControl = this.dialog().curFormGroup(); 
    formBuildGroupControl.columns(2); 
} 
public void getFromDialog() 
{ 
    super(); 
    this.getSearchIntervalFromDialog(this.dialog()); 
} 
protected void getSearchIntervalFromDialog(Dialog _dialog) 
{ 
    BOMPartOfContract contract = this.dataContractObject(); 
    FormGroupControl dialogSearchIntervalGroup = _dialog.formRun().control(_dialog.formRun().controlId('Date')); 
    contract.parmSearchInterval(dialogSearchIntervalGroup.optionValue()); 
}

The following code illustrates the contract for the BOMPartOf report.

[ 
    DataContractAttribute, 
    SysOperationContractProcessingAttribute(classstr(BOMPartOfUIBuilder),     
SysOperationDataContractProcessingMode::CreateUIBuilderForRootContractOnly), 
    SysOperationGroupAttribute('Date', "@SYS25853", '4'), 
    SysOperationGroupAttribute('ViewGroup', "@SYS5252", '5') 
] 
public class BomPartOfContract 
{ 
...