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

Multi-value lookup


All the report dialog controls that we have seen so far in this book only store a single value. But there can be cases where you want the users to be able to choose multiple values. This recipe is going to show you how to do it.

Getting ready

This recipe will extend the PKtInventBatchReport built in Chapter 4, Report Programming Model – RDP.

How to do it…

This recipe will add a multi-value lookup for the batch ID so that the user can select multiple batches to be printed in the report:

  1. The first step is to create a parm method in the contract of type list. The parm method should appear as seen here:

    [
        DataMemberAttribute('MultipleBatch'),
        SysOperationLabelAttribute("Multiple Batch"),
        AifCollectionTypeAttribute('return', Types::String)
    ]
    public List parmMultiBatch(List _multiBatch = multiBatch)
    {
        multiBatch = _multiBatch;
        return multiBatch;
    }
  2. Once the parm method is added, the dialog shows a report with a list control, but the lookup has no values in it. To...