Wednesday, 12 August 2020

Layers and Models

 

Layers and Models

 

Layer:  We have 8 layers in dynamics, a layer system is used to manage objects. The USR layer is the top layer and the SYS layer is the bottom layer, and each layer has a corresponding patch layer above it.

USR: The user layer is for user modifications, such as reports.

CUS: The customer layer is for modifications that are specific to a company.

VAR: Value Added Resellers (VAR) can make modifications or new developments to the VAR layer as specified by the customers or as a strategy of creating an industry specific solution.

ISV: When an Independent Software Vendor (ISV) creates their own solution, their modifications are saved in the ISV layer.

SLN: The solution layer is used by distributors to implement vertical partner solutions.

FPK: The FPK layer is an application object patch layer reserved by Microsoft for future patching or other updates.

GLS: When the application is modified to match country or region specific legal demands, these modifications are saved in the GLS layer.

SYS: The standard application is implemented at the lowest level, the SYS layer. The application objects in the standard application can never be deleted.

Patch Layers: Each layer in Microsoft Dynamics AX has a corresponding patch layer that can be used to incorporate updates to your application or to store conflicts when you import models into a layer.

 


 

 


 

  

 

 

 

Models


Microsoft Dynamics 365 Finance & Operations needs package, model and project to start development or customization

  • Run visual studio as Administrator
  • Go to the Dynamics 365 > Model Management > Create model
  • Fill the Add parameters form > click Next 
  • Select Create New Package > click Next 
    Create new package will create a new and separate package. The model will be created in the newly created package. It is the extension approach of development.
    Select existing package will give you option to select the existing package from list in which you want to create the model. It is the overlayering approach of development.

·       Select packages you want to add in your model as reference. 

  • In your model, you have to add the references of all the packages you are going to develop using extension approach.

·       Select packages you want to add in your model as reference. 

  • Tick create new project option if you want to create project in newly created model.
  • Tick the make this my default model for new projects option if you want to add every new project in this model by default.
  • Click Finish. 

 

 

Sunday, 21 December 2014

Data validation on tables Ax2012

The validation method allow the programmers to verify that certain conditions are fulfilled before an execution is executed.

Method validation can be programmed at two levels

  1. Table 
  2. Origin if data of a form.
whenever it is possible the validation of the data must be made in the table.

The method validation of a table are
  1. ValidateField
  2. ValidateWrite
  3. ValidateDelete

Saturday, 22 November 2014

Difference between New() and Construct()

Construct:
This method returns an instance of a class, it is a best practice to have a construct method in your class.

This method should be static but can be private or private depending on case, when calling a class from another class or job construct method can be use for this.

New:
This method is default constructor of a class, Invokes when user uses a "new" keyword.

Mostly it is protected.


Base Enumeration


  • These are predefined text values for a field that are referenced through an integer in the database.

Table group in Ax2012.


  • Table group provide a method for categorizing tables according to the type of the data they contain.
  • When exporting data you can use tables groups to filter the records.
  • Some of the tables groups are Parameters, Group, Main, Transactions, WorksheetHeader, worksheetLine, Miscellaneous. 


Index and Index hint in Ax2012

Index:
When we index in select statement it implies that the declare index field should behave as an order by and is optional the database to use. database can use its own preferences.

Index Hint:
Index hint in select statement will force the database to choose index for fetching data whether it is correct or not.


Maps in AX

  • Map is a logical collection of almost identical table.
  • A map is a compensation for the fact that tables cannot inherit properties from one to another.
  • A map can unify the access to similar columns and methods that are present in multiple tables. This enables you to use the same field name to access fields with different name in different tables.

Relations in Table in Ax2012

Relations between tables are used to associate rows in one table to rows in another table.

Relations are used to
  1. Enforce business rules across tables.
  2. Create auto joins in forms.
  3. Validate data by providing constraints.
  4. Look up values in other table.
  5. Generating field help.

Delete action in Ax2012

There are four delete actions:

  1. None: A None delete action will delete selected row in a table but nothing occurs to the table that relate to this table.
  2. Cascade: A Cascade delete action will delete all the records in the related table, i.e, deleting the parent record will also delete child record in the related table.
  3. Restricted: A Restricting delete will raise an error message if the user tries to delete a record, where records exists in related table where the foreign key is equivalent to the primary key of the current table.
  4. Cascade + Restricted: The delete action performs an restricted, if the record of the table will  be deleted directly and performs an cascade, if the record of the table will be deleted through a cascade delete action of a database.

Index in Ax2012

Indexes in database are used to locate records, They are stored separately in the database and contains a key that can be quickly located in the index and the reference to the record.

There are two types of index;
  1. Unique
  2. Non- Unique
In a unique key it ensures that no duplicate value occurs in the column.

Non-Unique key provide quick o retrieving data, instead of performing full table search of all the records in a table.

Primary Index:
A primary index is a unique index for a table that defines the primary key for that table.

To set the index as unique index, set the property Allow duplicate to 'NO'.

Clustered Index:
It is a physical order in which the records are stored in a table. 

In clustered index on a text field called "Name" and you insert a record with a letter 'D', the record will physically be inserted between C and E record.

Clustered index do not have to be unique.

Surrogate key;
When a primary index is not specified, Ax uses a surrogate key as primary index

The RecId is the key that is used as surrogate key

The surrogate key is used on many relations between tables.


Extended Data Type (EDT) in Ax2012

  • EDT is user defined definition of a primitive datatype.
  • EDT extends primitive datatypes or other EDT's.
  • The benefit of creating EDT is reuse of their properties, Another benefit is more efficient maintenance.  

Create Extended Data Type:

You can create an extended data type in the Application Object Tree (AOT), and then base a table field on this type.
  1. In the AOT, click Data Dictionary.
  2. Right-click Extended Data Types, click New, and then click a data type to base the extended data type on.
  3. Right-click the extended data type you created in step 2, and then click Properties.
  4. To base the extended data type on another extended data type, select an extended data type from the Extends property list.
  5. The list of available extended data types varies, depending on the base data type that you selected in step 2.
  6. Modify additional properties, as needed.
Press CTRL+S to save the extended data type.

Monday, 1 July 2013

SSRS Instalation & Configuration

Before start developing SSRS report for MS Dynamics AX, you need to install BI components and Visual Studio tools from MS Dynamics AX setup. The setup form is shown below with BI Components and Visual Studio tools options checked:



After installing BI Components and Visual Studio tools, you are ready to start working on SSRS reports for MS Dynamics AX. To verify that the BI Components installed successfully and report servers are correctly configured in MS Dynamics AX, Go to Tools -> BI tools -> BI reports servers. Configuration form is shown below:




Verify that the values are filled in and server name is the name of your machine. 

Tuesday, 18 June 2013

Query Report in AX

Steps for Creating Simple Query Report

1. Get required mapping from FDD(Functional Design Document) and list of required tables & fields.

2. Create Query with the Necessary fields.




3. Open Visual Studio

  •  Select new project
  •  Select Dynamics Ax template
  •  Choose Report Model





Give name to to visual studio project with name appended with 'Report'.
Ex : SimpleQueryReport.

4. Now go to Solution explorer 

  •  Right click on project 
  •  Add new Report






The purpose of each report items is described below:
Ø  Datasets: The report dataset retrieves data from the AOT query. All fields which are available in AOT query are shown in the report dataset which can be referred in the report design later on.
Ø  Designs: The design or layout of the report on which the data would be displayed after retrieving from AX.
Ø  Images: Any embedded images that you want to display on SSRS report.
Ø  Data Methods: Business logic written in C#. Data methods are no more recommended.

Ø  Parameters: Report parameters which are to be displayed on SSRS report and user can filter the report based on those parameters.

5. Now go to Dataset  

  •  Add new Dataset (Name it as Dataset1).




6. Go to Dataset1 properties

  •  Select the Datasourse type as query
  • Now select Query



7. Expand the fields and check the required fields



8. Go to Design and add design as per the requirement.


9. Go to the properties of Autodesign and set.
  • Select layoutTemplate as ReportLayoutStyleTemplate.

10. Now Drag and drop Dateset1 into the Atodesign1 and select properties
  • Give name as Dataset1Table
  • Select StyleTemplate as TableStyleAlternatingRowsTemplate



11. Now Goto Buid and buid the project
  • After build Deploy the project


12. After deploying Add the report to the AOT.



13. Once we deploy Report Goto AOT --> Visual Studio --> Dyamics Ax Model project and Refresh it.


14. Now go to AOT in Ax and Refresh SSRSReport.
  • Select the report you created.


14. In AOT go to MenuItems
  • Right click on Output Add new Menuitem ( as SimpleQueryReport).
  • Goto Properties and Give Name, label, HelpText.
  • Give ObjectType as SSRSReport.
  • Select Object as we created in SSRSReport.


15. Select Report Design and Save it.



16. Click on the SimpleQueryReport in menu item and run it to get the desired Report.


Monday, 10 June 2013

Report Type & Designs

Report Types : In AX there are two types of Reports

  • Query Report
  • RDP Report

Query Report : We can create reports using AOT Query(static query). This approach is suggested when data is coming direct from tables.

RDP Report : RDP report involves business logic according to the requirement  This logic may be calculations or getting values from different tables based on conditions.



Report Designs : Reports in AX are used to display data to users in a format which is suitable for the way that the information is read.
A report can have multiple designs so that the code can decide at run-time which design to use. The designs can be totally different, but they would share the same data sources and form methods.

There are two common design patterns
  • Auto Design
  • Precision Design
Auto Design : This report is automatically generated based on the query in the data sources of the report. It Limits the possibilities for the developer as developer cannot make any changes in the design of report.

Precision Design : The developer has full control over the design, he can modify the design according to the requirement.




Thursday, 6 June 2013

SSRS Program Flow

Controller Class : This class Controls flow of execution of reports.

  • This class is used to perform some task before opening dialog, after closing dialog and before rendering report.
  • It allows users to call the different Designs in a report based on conditions.
  • Controller class also handles arguments passed from other classes and forms.

UI Builder : This class is used to create a dialog and handling events in dialog. Parameters in dialog are fetched from Query and Contract classes.

Contract Class : It consist of Parm methods which can be used for setting or getting values. this class is used for generating UI parameters.

RDP Class : It stands for Report Data Provider. This class contains business logic to populate the report.  
  • Process report is a entry point for the RDP class where this method executes first.
  • Insert method : This method is used to insert the values into the temporary table which are coming from different tables and some calculated fields of the table.
  • Get method : This method is used to return table buffer to the SSRS to process report output based on the temporary fields and data.

Tuesday, 28 May 2013

SSRS ( SQL Server reporting services )

SSRS provides a tools and services to help you  to create, deploy, and manage reports for your organization. By this programming features that enable you to extend and customize your reporting functionality.
It is a report generation software that is a part of Microsoft SQL Server.
It enables users to execute reports using a web interface or even as embedded reports in applications by using a web services interface.

Report Life Cycle


Microsoft Dynamics Ax SSRS Reports

SSRS
SSRS Architecture
SSRS Program Flow
SSRS Instalation & Configuration
Reports Type & Design
Query Reports
RDP Reports
Controller Class
RDL/RDP Contract Class
RDP Classes
UI Builder Class
Auto Design
Precession Design
Static Parameters
Dynamic Parameters
Drill Through
Graphical Reports
CUBE/ MDX Reports