What are OOPS concepts?
The main concepts of OOPS used in D365
FO are:
- Class and
Objects
- Data
Abstraction: Showing only the essential information and hiding background
details.
- Encapsulation:
Wrapping of data member and method to a single unit.
- Inheritance
Flowing of property of the parent class to the child class.
- Polymorphism is the property of repeatedly using the same method to perform
different things.
Interfaces & Abstract Class
The class implementing is the interface
that implements all interface methods and there will not be any abstract Class
requirement. There are many access modifiers available like abstract,
protected, virtual, internal, public, and many more that are useful in the
abstract Classes. Abstract classes will be very fast when compared to
interfaces.
|
Interfaces |
Abstract
Class |
|
The interface
is the signature for a particular method. |
Abstract
class contains both the incomplete and complete methods. |
|
Interface
cannot be an implemented method |
The
abstract class is the implemented method. |
|
The
interfaces do not contain constructors, fields, or destructors but they
have only the property’s signature with no implementation. |
The
abstract class contains constructors, fields, or destructors for implementing
the properties. |
|
The interface supports multiple inheritances. |
The
abstract class does not support multiple inheritances. |
|
The
class can also inherit more than one interface. |
The
class can inherit only one abstract |
What are EDT and Base Enum?
EDT or Extended Data Type and Base
Enumerations (Enums) are data types. They are created and managed in the
development environment. Extended data types can be primitive data types like
integers, strings, real numbers, and booleans. EDT extends the original
properties of the data type that they inherit. In addition, some extra
properties are added.
Base enums are a fixed set of values.
Those values in the database are saved as integers but they have also a name (as
referenced from X++ code) and a label (visible to users). You can have up
to 255 values for Base enums. The integers in the database will take on the
values 0 through 254.
The AOT in D365FO apps contains many
existing EDTs and base enums that can be extended for use in your project, or
you can create new data types
Difference between
Clustered and Non-clustered index
An index is a disk-based structure linked to a
table or view that facilitates quicker row retrieval. A table or view’s table
or view’s columns are used to create keys in an index.
Clustered Index
A clustered index is created only when
both the following conditions are satisfied –
1.
The data or file, that you are moving into
secondary memory should be in sequential or sorted order.
2.
There should be a key value, meaning it can not
have repeated values.
Whenever you apply clustered indexing
in a table, it will perform sorting in that table only. You can create only one
clustered index in a table like a primary key. A clustered index is as same as
a dictionary where the data is arranged in alphabetical order.
Non-Clustered Index
The non-clustered Index is similar to
the index of a book. The index of a book consists of a chapter name and page
number, if you want to read any topic or chapter then you can directly go to
that page by using the index of that book. No need to go through each and every
page of a book.
The data is stored in one place, and
the index is stored in another place. Since the data and non-clustered index are
stored separately, then you can have multiple non-clustered indexes in a
table.
In a non-clustered index, the index
contains the pointer to data.
Difference between Clustered and
Non-Clustered index
|
CLUSTERED INDEX |
NON-CLUSTERED INDEX |
|
A
clustered index is faster. |
A
non-clustered index is slower. |
|
The
clustered index requires less memory for operations. |
A
non-clustered index requires more memory for operations. |
|
In
a clustered index, the clustered index is the main data. |
In
the Non-Clustered index, the index is the copy of data. |
|
A
table can have only one clustered index. |
A
table can have multiple non-clustered indexes. |
|
The
clustered index has the inherent ability to store data on the disk. |
A
non-clustered index does not have the inherent ability to store data on the
disk. |
|
Clustered
index store pointers to block not data. |
Non-Clustered
index storescontainThe non-clustered both value and a pointer to the actual
row that holds data. |
|
In a Clustered index leaf nodes are actual data itself. |
In a Non-Clustered index leaf nodes are not the actual data itself rather they
only contain included columns. |
|
In
a Clustered index, the Clustered key defines the order of data within a table. |
In
a Non-Clustered index, the index key defines the order of data within the
index. |
|
A
Clustered index is a type of index in which table records are physically
reordered to match the index. |
A
Non-Clustered index is a special type of index in which the logical order of
the index does not match the physical stored order of the rows on the disk. |
|
The
size of The primary clustered index is large. |
The
size of the non-clustered index is compared relatively composite is
smaller. |
|
Primary
Keys of the table by default are clustered indexes. |
The
composite key when used with unique constraints of the table acts as the
non-clustered index. |
What are Delete Actions in D365 FO
Delete Actions and OnDelete property indicate
how deletions in the main table are handled in the related tables or child
tables.
There are 3 types of options available.
Cascade,
Restricted
Cascade +
Restricted.
Cascade:
If you have one parent table ParentTable and you have one
child or related table ChildTable. If you are going
to use CASCADE delete action or On delete property then
on deletion of records in TABLE ParentTable, related records
in TABLE ChildTable will also get
deleted.
Restricted :
If you have one parent table ParentTable and you have
one child or related table ChildTable. If you are going
to use a RESTRICTED delete action or On delete property then on the deletion of a record in TABLE ParentTable, the system will not validate records in
related Table ChildTable. If a related record exists in Table ChildTable then the system
will not allow you to delete the record in Table ParentTable and throw an
error.
CASCADE RESTRICTED
if we have 3 tables i.e. parent table
warehouse& related tables supermarket & stores. Table store is a child
or related table of Table Supermarket and similarly, Table Supermarket is a child or related table of parent Table Warehouse. If we set the delete
action CASCADE in between Parent Table warehouse and Related Table supermarket
and again if we set the delete action CASCADE RESTRICTED in between Table
supermarket and Related Table stores. Then on the deletion of the record in the Parent
TABLE warehouse, the system will also delete all the related records of the TABLE supermarket & stores. But if you try to delete records in the supermarket and
related records exist in Table stores then the system will not allow to delete
records.
What are Table Relations in D365?
A table relation associates two tables
that contain related information. Usually, the primary key field of one table
appears as a foreign key field of the related table. The table with the primary
key is called the parent table. The table with the foreign key is called the
child table.
In Microsoft Dynamics 365 there
are :
- Normal
Relation
- Field
Fixed Relation
- Related
Field Fixed Relation
- Foreign
Key Relation
A normal relation is
used to specify a relation without any conditions. A normal relation specifies
related fields in another table. Multiple fields can also be added in normal
relations.
Condition is, Table1.Field
= Table2.Field
A Field Fixed Relation is
used to specify relation fields to restrict the records in the primary
table. Only records that meet the condition are selected. The field fixed
is normally an enum.
The condition is ANDed with your
relation here Table.Field = <EnumValue>
A Related Field Fixed
Relation is used to specify relation fields to restrict the
records in the related table. Only records that meet the condition are
selected. The Related field fixed is normally an enum.
The condition is ANDed with your
relation here, <EnumValue> = Table.Field
A Foreign Key Relation is
used to specify a correspondence between a foreign key field in the
present table to the primary key field in another parent table.
What are the different types of Menu Items available in D365?
There are three types of menu items in
D365 FO:
Display Menu Item: Use this
type when the menu item opens a form.
Output Menu Item: Use this
type when the menu item will opening an SSRS report.
Action Menu Item: Use this
type when the menu item will run a batch job. Or some other process, such as
run by a class.
What is the chain of command?
Chain of Command is the term that
describes how we customize or extend, base Microsoft code in Microsoft
Dynamics 365. Microsoft's base objects and code cannot be changed directly in
D365.
The name of the new class you create
must end with the text ‘_Extension’. In the example above, the base Microsoft
class was named ‘Class’. The name of the class we created was
‘Class_Extension’.
There are several different objects in
Microsoft Dynamics 365 that can use a Chain Of Command. I will list the most
common here.
|
Classes |
[ExtensionOf(classStr(<NameOfBaseObject>))] |
|
Tables |
[ExtensionOf(tableStr(<NameOfBaseObject>))] |
|
Forms |
[ExtensionOf(FormStr(<NameOfBaseObject>))] |
|
Datasource on a form. |
[ExtensionOf(formDataSourceStr(SalesTable,
SalesLine))] |
|
Data field on a form |
[ExtensionOf(formDataFieldStr(<NameOfBaseForm>,<NameOfDataSource>,<NameOfField>))] |
|
Control of a form |
[ExtensionOf(formControlStr(<NameOfBaseForm>,<NameOfControl>))] |
|
Data entities |
[ExtensionOf(tableStr(<NameOfBaseDataEntity>))] |
Explain the difference between extensions and overlays in Dynamics 365 customization.
In Dynamics 365, customizations are achieved through extensions and overlays.
Extensions add or modify functionality without changing original code, aiding in updates and maintenance.
Overlays involve modifying original code, which can complicate updates and maintenance.
What are some common performance optimization techniques in Dynamics 365?
Performance optimization in Dynamics 365 involves:
- Database Optimization: Use indexing, query optimization, and regular maintenance.
- Code Optimization: Write efficient X++ code, minimize nested loops, and use caching.
- System Configuration: Ensure adequate resources and optimize settings.
- Batch Processing: Schedule jobs during off-peak hours and distribute them.
- Data Management: Archive and purge old data, and consider data partitioning.
- Monitoring and Diagnostics: Use tools to monitor performance and review metrics.
What are delegates in X++, and how are they used? Provide an example.
Delegates in X++ define a method signature for event handlers. They are declared with the
Example:
Here, MyDelegate is declared in MyClass, and RaiseDelegate calls subscribed methods. EventHandlerClass contains the handler method.
Comments
Post a Comment