-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"Implemented query to fetch top 5 consumers in Dynamics 365 Business…
… Central - Created a new query 'Top 5 Consumers' with a normal query type - Defined query properties: caption, order by, and top number of rows - Utilized dataitem 'Cust. Ledger Entry' with filters and columns for customer information and sales - Implemented aggregate function 'Average' for sales - Organized code with clear variable declarations and trigger sections - Improved code readability by using descriptive names and proper indentation"
- Loading branch information
Showing
5 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
query 50106 "List of Attachees" | ||
{ | ||
Caption = 'List of Attachees'; | ||
QueryType = Normal; | ||
QueryCategory = 'Customer List'; | ||
|
||
elements | ||
{ | ||
dataitem(Customer; Customer) | ||
{ | ||
column(Address; Address) | ||
{ | ||
} | ||
column(Amount; Amount) | ||
{ | ||
} | ||
column(Balance; Balance) | ||
{ | ||
} | ||
column(City; City) | ||
{ | ||
} | ||
column(Contact; Contact) | ||
{ | ||
} | ||
column(Comment; Comment) | ||
{ | ||
} | ||
column(County; County) | ||
{ | ||
} | ||
column(EMail; "E-Mail") | ||
{ | ||
} | ||
column(Name; Name) | ||
{ | ||
} | ||
} | ||
} | ||
|
||
trigger OnBeforeOpen() | ||
begin | ||
|
||
end; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
query 50107 "Top 5 Consumers" | ||
{ | ||
QueryType = Normal; //This is a normal query | ||
Caption = 'Top 5 Consumers'; //Obvious, the caption | ||
OrderBy = descending(Sales__LCY_); //Query is sorted in the descending order | ||
TopNumberOfRows = 5; //This now returns the top 5 rows | ||
QueryCategory = 'Customer List'; //This will add this query in the CustomerList dropdown | ||
|
||
elements | ||
{ | ||
dataitem(Cust__Ledger_Entry; "Cust. Ledger Entry") //This is defining a data item whereby the query will retrieve data from | ||
{ | ||
filter(Posting_Date; "Posting Date") //This filter is not actually doing anything, but it acts a s a placeholder for a filter for Posting field | ||
{ | ||
|
||
} | ||
//Columns below are defined and therefore inculded in the query result | ||
|
||
column(Customer_No_; "Customer No.") | ||
{ | ||
|
||
} | ||
column(Customer_Name; "Customer Name") | ||
{ | ||
|
||
} | ||
column(Sales__LCY_; "Sales (LCY)") | ||
{ | ||
Method = Average; //This specifies that the sales(LCY) column should be calculated using the average method | ||
} | ||
} | ||
} | ||
|
||
var | ||
myInt: Integer; | ||
|
||
trigger OnBeforeOpen() | ||
begin | ||
|
||
end; | ||
} |