change nav 1-patterns formatting

This commit is contained in:
christianbraeunlich 2021-12-05 19:02:27 +01:00
parent ba12637e35
commit 7e4e21d223
54 changed files with 211 additions and 250 deletions

View file

@ -23,11 +23,11 @@ Let's consider the **VAT Entry** table as below: [
[![ ][image0]][anchor1]
The goal is to select one line for each separate document that produced VAT Entries. In other words, we want records grouped by **Type, Document Type **and**Document No.**. However, if there are multiple lines with the same value of the triad **Type, Document Type **and**Document No.** in the **VAT Entry **table, we only want to see one of them.
The goal is to select one line for each separate document that produced VAT Entries. In other words, we want records grouped by **Type, Document Type** and **Document No.**. However, if there are multiple lines with the same value of the triad **Type, Document Type** and **Document No.** in the **VAT Entry** table, we only want to see one of them.
#### **Solution**
Create a new query object **VAT Entry Distinct Document No.**, with a single DataItem sourced from **VAT Entry** table. Add the three desired group-by fields **Type, Document Type **and**Document No. **as columns.
Create a new query object **VAT Entry Distinct Document No.**, with a single DataItem sourced from **VAT Entry** table. Add the three desired group-by fields **Type, Document Type** and **Document No.** as columns.
[![ ][image1]][anchor2]
@ -45,7 +45,7 @@ Running the query yields a single record per document. You can notice in the sec
One thing is to be noted: there is a limitation to how much information you can take out from the records. For example, if we need to extract more information than just the one we already have in the columns, then the following apply: adding one more column of **Method Type** = **None** will indeed show more information, but it _might_ affect the grouping. More details below.
**The grouping is affected **for example****when the additional column is the **VAT Entry No**. In this case, this column brings up additional grouping criteria and one group for each entry number will end up being created.
**The grouping is affected** for example when the additional column is the **VAT Entry No**. In this case, this column brings up additional grouping criteria and one group for each entry number will end up being created.
[![ ][image4]][anchor5]

View file

@ -1,9 +1,8 @@
+++
title = "use Queries to Detect Duplicate Records"
title = "Use Queries to Detect Duplicate Records"
weight = 1340
+++
_Originally by Abshishek Ghosh and Bogdan Sturzoiu at Microsoft Development Center Copenhagen**
**_
_Originally by Abshishek Ghosh and Bogdan Sturzoiu at Microsoft Development Center Copenhagen_
## **Abstract**
@ -33,13 +32,13 @@ Before Dynamics NAV 2013, the only possibility was to iterate through the table
This code would involve setting filters on the **Customer** table as many times as there are records in the table. This is an expensive operation.
Starting with Dynamics NAV 2013, we can use queries to create a more efficient implementation of the same logic.****
Starting with Dynamics NAV 2013, we can use queries to create a more efficient implementation of the same logic.
## **Usage**
The solution involves that you create a query to return duplicates, and then invoke it from a method that would test the value of the query to identify if duplicates were found.
**Step 1 ****--****Creating the Query**
**Step 1** -- **Creating the Query**
* The query must be created with the table we want to search in as the dataitem.
* The field we want to search for must be created as a grouped field.
@ -84,7 +83,7 @@ Here is an alternate implementation of the **HasDuplicateCustomers** method usin
**Examples**
* **Acc. Sched. Chart Management **codeunit (762),
* **Acc. Sched. Chart Management** codeunit (762),
methods CheckDuplicateAccScheduleLineDescription and CheckDuplicateColumnLayoutColumnHeader
* **Analysis Report Chart Mgt.** codeunit (770),
methods CheckDuplicateAnalysisLineDescription and CheckDuplicateAnalysisColumnHeader

View file

@ -2,7 +2,7 @@
title = "Use Queries to Replace Nested Loops"
weight = 1350
+++
#### _Originally by Bogdan Sturzoiu, Microsoft Development Center Copenhagen_
_Originally by Bogdan Sturzoiu, Microsoft Development Center Copenhagen_
## **Abstract**
@ -28,7 +28,7 @@ The join operation has traditionally been done in C/AL by record looping. When N
[![ ][image0]][anchor0]
Figure 1\. The pattern elements
_Figure 1\. The pattern elements_
### **Usage**
@ -72,7 +72,7 @@ The classic C/AL approach is to:
END;
******Solution Using Query**
**Solution Using Query**
The new query-based approach involves: