Posts

Data entities in X++

Image
 what is data entity? ans:  -> A  data entity  is an abstraction from the physical implementation of database tables. why data entity is used? ans: -> Data entity is used for de-normalizing the database tables. -> Data entity is used for importing and exporting the data. Entity example: A consumer wants to access data that is related to a customer object, but this data is currently scattered across multiple normalized tables, such as DirParty , CustTable , LogisticPostalAddress , and LogisticElectronicAddress . Therefore, the process of reading and writing customer data is very tedious. Instead, the following customer entity can be designed to encapsulate the entire underlying physical schema into a single de-normalized view. This enables simpler read/write operations and also enables abstraction of any internal interaction between the tables.

Abstract class in x++

 ->  Abstract classes are identified by the keyword  abstract . ->    They cannot be instantiated but require a subclass that is inherited from the abstract class. ->  Abstract classes are used to implement a concept that the subclass will then complete. ->  Abstract methods can also be declared in abstract classes.   ->  Abstract methods do not allow code or declarations in the method. ->  A subclass must extend the abstract class to use the abstract method. Example: abstract class Vehicle {       str owner;       int age; void printInfo()       {     Info(strfmt("%1, %2",owner, age));       }     abstract void operate() // abstract method      {       // Abstract methods do not allow code or declarations in the method.     }  } Example: class Car extends Vehicle  // Car is a subclass ...

Inheritance in x++

 What is Inheritance in x++? answer:  Inheritance is  a concept where child class (derived class) can inherit all the methods and variables .  from parent class(base class) . Rules: ->  A class can extend only one other class. ->  Multiple inheritance isn't supported. ->  If we extend a class, the subclass (derived class) inherits all the methods and variables in the parent class (the  superclass ). ->  Subclasses let us reuse existing code for a more specific purpose. ->  A superclass is often known as a  base class , and a subclass is often known as a  derived class . How to prevent the inheritance? ans: We can prevent classes from being inherited by using the  final  modifier. Example: public final class Attribute {     int objectField; }

ENUM's in X++

 what is ENUM? ans: -> Enum is a list of literals. -> X++ does not support constants but as enumerable type (Enum). ->  Enum values are represented internally as integers. ->  The first literal has number 0, the next has number 1, the next has number 2, and so on.

EDT's in X++

 what is EDT? ans: Extended data types  are user-defined types that are based on the  boolean ,  int ,  int64 ,  real ,  str , and  date  primitive data types. An EDT is a primitive data type or container that has a supplementary name and additional properties. For example, we can create a new EDT that is named  Name  and base it on a string . we can then use the new EDT in variable and field declarations in the development environment.

Relations in X++

 There are four types of relations:   1. Normal Relation.   2. Field Fixed Relation.   3. Related Field Fixed Relation.   4. ForeignKey Relation. Normal Relation:   Normal Relation is to specify relation fields without conditions. Field Fixed Relation: Field fixed Relation is to specify relation fields to restrict the records in the primary table(Parent Table). Only  the records that meet the condition are selected. The field fixed is  normally an  enum . Example:                       Field Fixed :- Table.Field == <EnumValue> Related Field Fixed Relation: Related field fixed to specify relation fields that restrict the records in the related table. Only  the records that meet the condition are selected. The field fixed is  normally an enum . Example:                   Related field fixed :- (<EnumValue> == Table...

Joins in X++

  There are basically four types of joins in Ax,  Inner Join Outer Join  Exists Join Notexists Join Inner Join  :  Inner Join will return records from both Outer table and Inner table, only the records which are available in Inner table. Inner Join will also return duplicate records. Outer Join  :  Outer Join will return all the records from both Outer table and Inner table. Outer  Join will also return duplicate records. Exists Join  :  Exists Join will return records only from Outer table which are available in Inner Table. It will not return any duplicate records.  NotExists Join  :  Not Exists Join will return records only from Outer table which are not available in Inner Table. It will not return any duplicate records.