Book Image

Microsoft Dynamics AX 2012 R2 Services

Book Image

Microsoft Dynamics AX 2012 R2 Services

Overview of this book

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

Custom UI Builders


One of the great improvements that the SysOperation framework has over the RunBaseBatch framework is that it generates the dialog for you. Fields on the dialog, for example, are generated based on the data contract. However, if you want to change the dialog that is generated, you can use the UI Builder classes.

When we say custom UI Builders, we mean a class that extends the SysOperationAutomaticUIBuilder class. This is the class that generates the dialog based on the data contract of your service operation. By extending this class, you can add your own logic to the building process. Most commonly, this will include logic that does the following:

  • Set properties of field controls such as mandatory and enabled

  • Override methods of field controls such as lookup() and modifiedField()

  • Prevent controls from being added by overriding the addDialogField() method

When you create your own UI Builder class, you will notice that the possibilities go far beyond what we have just described...