Book Image

Microsoft Dynamics AX 2012 R3 Reporting Cookbook Update

Book Image

Microsoft Dynamics AX 2012 R3 Reporting Cookbook Update

Overview of this book

Table of Contents (17 chapters)
Microsoft Dynamics AX 2012 R3 Reporting Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing validation in reports


Validations are important to ensure the integrity of the process. Here, in this recipe, let's see how we can implement validations for reports.

Getting ready

The sample discussed is extending the InventBatch report discussed in the Creating an advanced RDP report recipe in Chapter 4, Report Programming Model – RDP.

How to do it…

  1. To make a parameter mandatory, in the report model in Visual Studio, expand and open the parameter that you wish to make mandatory. In the Properties node, ensure that the AllowBlank property is False. Modify it to True if the parameter needs to be optional. This property by default is False, so any property is mandatory by default. Also, you can set Default Value if you want. This is particularly useful for Boolean type parameters where the default value can be True in some cases.

  2. Sometimes the validations go beyond verifying mandatory. In that case, the validate operation must be implemented in the contract. As we have seen in previous...