In Dynamics 365 for Finance and Operations, SQL statements can often become performance bottlenecks. Therefore, it is very important to understand how Visual Studio handles database queries and to follow all the best practice recommendations in order to keep your system healthy and efficient.
In this recipe, we will discuss some of the best practices to use when writing database queries. For demonstration purposes, we will create a sample find
method with different logic and queries and discuss each of them. The method will locate the CustGroup
table record of the given customer account.
- As methods are not allowed on extensions, to demonstrate this recipe we need to over layer a
CustGroup
table. Add aCustGroup
table in your project, and create the following method:
/// <summary> /// /// </summary> /// <param name = "_custAccount"></param> /// <param name = "_forupdate"></param> ...