Posts

Showing posts from December, 2022

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.

Instance and local variables in x++

  Instance variables: -> These variables are declared in the class declaration and can be accessed from any method in  the class  and subclasses that extend the class, if they are declared public or protected . Local variables: These variables are defined in a method and can only be accessed in that method. The instance variables  a  and  b  can be accessed, and the parameters  x  and  y   act like local variables. Using parameters allows values to be assigned to those parameters when the method is called. If  method1  is called by using the code  Test.method1(a,b); , the  x  variable will be assigned the value  Car  and the  y  variable will be assigned the value  20 . You can then use the values of the parameter variables to assign values to the instance variables  c  and  d . Example:          class Test         ...

Declaring Const Values in X++

 We can declare a constant value in X++ by using const keyword  before defining a variable.    where         value does not change Ex: const str constantVariable = "Value"; const int age=45;

Design and create models

 what is model? answer: -> A model is a group of elements, including metadata and source files that define a solution with customizations.  -> These models are included in packages, which can be turned into a deployable package.  -> Finance and Operations uses deployable packages to deploy customizations and updates to your environments. ->    In finance and operations apps, models are mandatory for customizations. ->     Models can be thought of as a collection of Microsoft Visual Studio projects. ->    Projects can only be assigned to a single model.   ->   Models can help identify where certain objects are stored.  

ALM (Application Lifecycle Management ) Methodologies

Image
 *** -> Methodologies for ALM can vary, so choosing the correct methodology for your needs is             crucial for development. ->  The goal of this module and ALM is to help increase developer productivity, improve                    collaboration between teams, and provide transparency for work items. ->  There are several approaches to ALM. Each methodology has advantages and disadvantages, depending on the type of project and software being used.     The three common methodologies are Waterfall , Agile , and Spiral . The Waterfall methodology should be considered when the project is simple , the requirements are known and well-defined , the full scope of the project is not intended to change, and the project is implemented all at once . T he Agile approach is useful when the requirements are unclear when the project starts, additional requirements or deliverable...

Interface in X++

 what is interface? answer:  ->  interface is a specification for a set of public instance methods. ->   An interface defines and enforces similarities between unrelated classes without                         having to  derive one class from the other.   -> All interfaces are public only even we don't explicitly add the public keyword in front of the                    interface   keyword in the class declaration. -> The methods of an interface are also public . To create an interface, follow these steps: In Solution Explorer, right-click the project, and then select  Add . In the Dynamics 365 Items select  Code , select  Interface  and then enter a name for the interface. Select  Add . Interface Example: public interface IDrivable { public int getSpeed ( ) // public me...

Delete row if a certain field is blank --SSR Report

Right-click on the column header in design mode, choose Column Visibility, click Show or hide based on an expression. Enter the expression above. Click OK, and test. =IIf(Fields!Text2.Value = "", True, False)

How to override the D365 JumpRef to open a different form, or pass information to filter the form in a different way.

 Important note: If a field has no table relations or EDT table relations, then the field value does not show as ‘blue text’. Additionally, when the user right-clicks on the field, the option for ‘ view details ‘ does not show up.

how to delete multiple records from form in x++

Image
   SET Multiselect property to 'YES' in button properties. override the clicked method in button methods. public void clicked()         {                        super();             Employee_ds.deleteMarked();           }     

Display Option Method in X++

   The displayOption method is used to set display options from a stored profile and to override the background color that is based on the settings for the particular record. public void displayOption(Common _record, FormRowDisplayOption _options)         {             Employee profile;             profile = _record;             if(profile.EmpSalary<=15000)             {                 _options.backColor(WinAPI::RGB2int(255,0,0)); // red             }             super(_record, _options);         }

what is KPI in D365

 what is KPI? ans: KPI stands for key perfomance indicators. what is the use of KPI? ans: KPIs can be created in the developer environment and then embedded into workspaces to provide users with key measurable values that allow them to see how business is performing.  To create KPI, follow these steps: step1: In the Solution explorer, right-click your project and select Add New > New item. step2: Under Dynamics 365 Items select Analytics > Key Perfomance Indicator. step3: Select Add.

instance and static methods in x++

 what is instance method in x++? Instance method is  a method which require an object of its class to be created before it can be called.  what is static method in x++? Static methods is a method in x++ that can be called without creating an object of class.

how to disable new and delete buttons in standard forms

 [FormEventHandler(formStr(SalesTableListPage), FormEventType::Initialized)] public static void SalesTableListPage_OnInitialized(xFormRun sender, FormEventArgs e) { FormDataSource tablename_ds = sender.dataSource('TableName'); tablename_ds.allowDelete(false); //to disable delete button tablename_ds.allowCreate(false);  //to disable new button } salesTable_ds.allowEdit(false); //to disable save button } }

how to change timezone in ssrs report

 To change timezone in report 1.change the timezone in the VM(in which VM workspace you want to see the timezone changes) 2.open Task Manager 3.Go to services 4.Search for ReportServer 5.Restart the ReportServer.

Codingtips

 To comment the code use the following key first press CTRL+K and then press CTRL+C To uncomment the code use the following key first press CTRL+K and then press CTRL+U To format or indendation the code press CTRL+X+V To add a breakpoint press F9 keyword and to remove breakpoint again press F9 keyword only.

coc concept notes

  what is COC? ANS: -> COC stands for chain of command. -> CoC allows us to customize standard classes without using event handlers. -> COC  allows us to add custom logic that will run before and/or after the standard code runs. -> We  can only extend the logic of public and protected methods. ->  It is important to understand this concept, as base code cannot be changed in Dynamics           365 finance and operations apps development. -> When no more methods exist in the chain, the original (in other words, extended) method       is called. [ExtensionOf(classStr(BusinessLogic1))]  //name of the base class final class BusinessLogic1_Extension  //final keyword followed by class followed by baseobjectname _Extension {      str doSomething(int arg)      {         // Part 1  // the logic which we write before next method will get execute...

how to add current date and time and pagenumber in SSRS report

 1.To add current date and time in report use the follwing code now =Format(Now(), "MM/dd/yyyy hh:mm tt") To add total number of pages after the page number use the following code ="Page "&Globals!PageNumber &" of "&Globals!TotalPages To print date: Format(Now, "dd/MM/yyyy") To print time: Format(Now, "hh:mm tt") To print datetime use the following code: =Format(Now, "dd/MM/yyyy") & vbCrLf & Format(Now, "hh:mm tt") To print time depends on different time zones use the following code: =Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "d", Parameters!AX_RenderingCulture.Value) & vbCrLf & Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTim...

Screen Shots

Image