Book Image

Programming Microsoft Dynamics 365 Business Central - Sixth Edition

By : Marije Brummel, David Studebaker, Christopher D. Studebaker
Book Image

Programming Microsoft Dynamics 365 Business Central - Sixth Edition

By: Marije Brummel, David Studebaker, Christopher D. Studebaker

Overview of this book

Microsoft Dynamics 365 Business Central is a full ERP business solution suite with a robust set of development tools to support customization and enhancement. These tools can be used to tailor Business Central's in-built applications to support complete management functions for finance, supply chain, manufacturing, and operations. Using a case study approach, this book will introduce you to Dynamics 365 Business Central and Visual Studio Code development tools to help you become a productive Business Central developer. You'll also learn how to evaluate a product's development capabilities and manage Business Central-based development and implementation. You'll explore application structure, the construction of and uses for each object type, and how it all fits together to build apps that meet special business requirements. By the end of this book, you'll understand how to design and develop high-quality software using the Visual Studio Code development environment, the AL language paired with the improved editor, patterns, and features.
Table of Contents (12 chapters)
9
Successful Conclusions

The SETFILTER function

SETFILTER allows us to define and apply any filter expression that could be created manually, including various combinations of ranges, AL operators, and even wild cards. The SETFILTER syntax is as follows:

Record.SETFILTER ( Field, FilterString [, FilterValue1], . . . ] ); 

SETFILTER also can be applied to Query objects with similar syntax:

Query.SETFILTER ( ColumnName, FilterString  
[, FilterValue1], . . . ] ); 

FilterString can be a literal, such as '1000..20000' or 'A*|B*|C*', but this is not good practice. Optionally (and preferably), we can use variable tokens in the form of %1, %2, %3, and so forth, representing variables (but not operators) such as FilterValue1, FilterValue2, and so forth to be substituted in the filter string at runtime. This construct allows us to create filters whose data values can be defined dynamically at runtime. A new SETFILTER replaces any previous filtering in the same filter group (this will be discussed...