Pages

Friday 22 November 2013

what is model in ax 2012

model is a set of elements in a given layer. Each layer consists of one or more models. Each layer contains one system-generated model that is specific to that layer. Every element in a layer belongs to only one model. In other words, no element can belong to two models in the same layer, and every element must belong to a model.
A default model owned by Microsoft exists in each layer. Default models cannot be modified.
A model is permanently associated with the layer that the model was created in. If you need to move one of your models from one layer to another, you must create a project from the model in the Application Object Tree (AOT), export the project as an xpo file, create a target model in the desired layer, delete the original model to avoid having to resolve layer conflicts, and import the xpo file to the target model. If you are moving elements between models in the same layer, you can use the Move to modelcommand in the AOT.
Models are stored in the model store. The model store is a database in which all application elements for Microsoft Dynamics AX are stored. Customizations are also stored in the model store. The model store replaces the Application Object Data (AOD) files that were used in earlier versions of Microsoft Dynamics AX. Models that have been installed in the model store are used at run time.

Models can be exported to files that have the .axmodel extension. These files are called model files. Model files are deployment artifacts. Model files can be signed with strong name signing and Microsoft Authenticode signing.

Sunday 3 November 2013

Differences between RunBase & RunBaseBatch in ax

 RunBase class: The RunBase class is a framework for classes that need a dialog for user interaction and that need the dialog values to be saved per user. The RunBase application framework runs or batches an operation. An operation is a unit of work, such as the posting of a sales order or calculation of a master schedule.The RunBase framework uses the Dialog framework to prompt a user for data input. It uses the SysLastValue framework to persist usage data and the Operation Progress framework to show operation progress.

class RunBase extends Object implements SysSaveable, SysRunable

RunBaseBatch class: All jobs that must be able to run in a batch must inherit from this class. The RunBaseBatch framework extends the RunBase framework, and X++ classes that extend this framework can have their operations enlisted in the batch queue.

class RunBaseBatch extends RunBase implements Batchable
RunBaseReport class: The RunBaseReport class makes all reports batchable and creates a standard dialog box.  

class RunBaseReport extends RunBaseBatch

This class is instantiated through the SysReportRun Class. It should be used by all reports. The purpose of the class is to:
 - Make all reports batchable
 - Create a standard dialog
 If you are creating more complex reports, it might be necessary to inherit from this class. If this is the case, you must create the following methods:  
lastValueElementName(). Returns the report name.
description(). Static.
 main(). Static. 

Differences between MorphX and Intellimorph

 MorphX is the Microsoft Dynamics AX IDE( Integrated Development Environment) which includes:
 - Data Dictionary
 - Tools for creating menus, forms and reports for Windows- and Web clients
 - Compiler and debugger for the object oriented programming language X++
 - Version control system
 - Label (multi language text) systems  
IntelliMorph is the Runtime Environment embedded in Microsoft Dynamics AX, that draws menus, forms, and reports for Windows- and Web-clients with the correct contents, size, and layout according to:
 - The language your texts are displayed in.
 - What features you can access.
 - How wide you want the fields on your installation.
 - The formats you are using for dates and numbers. 

Oops concept in AX

Class : Class is the 1st OOPs concept .Class defines the characteristics of objects which includes its attributes , fields  properties and behavior . Let us say we have a class called car , then the color , model number , top speed can be its attributes and properties . Accelerating , breaking , turning will be its behavior

Objects: Objects can be considered as a thing  that performs a set of related functions .Programming objects are used to model real worlds objects. An object is also an instant of a class . For our class Car , Ferrari  will be our object

Instance : One can have an instance of a class; the instance is the actual object created at runtime.  The set of values of the attributes of a particular object is called its state. The object consists of state and the behaviour that’s defined in the object’s class.

Method :Also called as  functions in some programming languages , methods defines the  behavior of particular objects . For our Car class , turning() , breaking ()  will be our methods .

Inheritance : a parent class can inherit its behavior and state to children classes. This concept was developed to manage generalization and specialization in OOP .Lets say we have a class called Car and Racing Car . Then the attributes like engine no. , color of the Class car can be inherited by the class Racing Car . The class Car will be Parent class , and the class Racing Car will be the derived class or child class

Abstraction : representing only the important details without including all the details . For example the car Ferrari can be treated as simple car only .

Encapsulation:The wrapping up of data and functions into a single unit is called as encapsulation . For example the class car has a method turn ()  .The code for the turn() defines how the turn will occur . So we don’t need  to define how Mercedes will turn and how the Ferrari will turn separately . turn() can be encapsulated with both.

Polymorphism: Its an important OOPs concept , Polymorphism means taking more than one forms .Polymorphism allows the programmer to treat derived class members just like their parent class’s members. More precisely, Polymorphism in object-oriented programming is the ability of objects belonging to different data types to respond to calls of methods of the same name .If a Dog is commanded to speak(), this may elicit a bark(). However, if a Pig is commanded to speak(), this may elicit an oink(). Each subclass overrides the speak() method inherited from the parent class Animal. 

What are the architecture changes done in AX 2012 R2?

 The model store and the transaction data are stored in separate OLTP databases. In other versions of Microsoft Dynamics AX 2012 prior to Microsoft Dynamics AX 2012 R2, the model store and transaction data are stored in a single OLTP. 

What is new in Dynamics AX 2012

  SSAS - Analysis service project wizard.
  AOS - Validfrom and validto columns, Unit of work class, Inheritance among the tables
  Client -Form styles, Search and parts
  EP - Sharepoint 2010, listpge famework, windows live authentication
  Morphe x - Models and model store, dev. workspace, some layers renamed and powershell
  SSRS – Labels in reports,  auto reports, cross reference can access, unlimited dimensions
  X++ -Eventing, attributes, .Net proxies to X++ classes, faster compilition 

Monday 29 July 2013

If any record is created in table I want to fetch the date & time stamp, how will you do that?

What does stamp mean?? if you want to fetch the created date&time for a record inserted in table, firstly go to table property and enable 'createddate' & 'createdtime' property. thereafter extra field will be created in your table browser. now once you create record, can easily track the date and time from this field.

Friday 26 July 2013

how many types of data validation methods are written on table level in axapta

The validation methods allow the programmer to verify that certain conditions are fulfilled before an action is executed.
In Axapta, methods of validation at two levels can be programmed:
  1. Table
  2. Origin of data of a form
It is important to know that the methods of validation of the tables are executed whenever they are introduced or erase registries. Whereas if the validation is made in the form, it will only work when we are working with that form.
  1. Whenever it is possible, the validation of data must be made in the table.

Methods

The methods of validation in tables are the following ones:
ValidateField
It is executed when we move the cursor from a field from the form to another one, that is to say, when we left a field. It gives back a data of boolean type. If the result is false, the cursor will remain in the field.
The call to the super method () verifies the validation relations, that is to say, relations in a field where the Validate property has affirmative value. Therefore, we must respect the task made by this super method ().
  1. Validations do not have to be codified that can be made with some property. Thus, we will avoid to write code in the ValidateField method if the conditions can be verified with the Validate property of a relation.
ValidateWrite
It is executed before inserting or updating a registry in the table. It gives back a data of boolean type. If it gives back false, the registry is not inserted or updates.
The call to the super method () examines all the fields to verify the value of the Mandatoryproperty. Therefore, we must respect the task made by this super method ().
  1. We will avoid to introduce code that it verifies if a field has value, whenever we pruned to use the Mandatory property.
ValidateDelete
It is not necessary to forget, that often also we want to verify certain conditions before erasing a registry of a table. In order to do this, we used the ValidateDelete method ().
ValidateDelete () is called automatically from forms and is used to verify if the present registry can be erased.
The call to the super method () verifies if there are registries related in tables toDeleteActions of the Restricted type. If that is the case, the super method () gives back false. Therefore, we must respect the task made by this method.
  1. Whenever we pruned to use a DeleteAction, we will avoid to introduce code in the ValidateDelete method.

Structure of the validation methods

In order to maintain a good structure of programming, he is recommendable that the code for the verifications is not located directly in these methods of validation. It is more advisable than we create verification methods that will be called from the methods of validation previously described.
Example of validation method
Boolean validateWrite ()
{
Boolean ret;
ret = checkSomething () && checkSomethingElse ();
return ret;
}
When some of the conditions is not fulfilled, the verification method must make two things:
  1. to present/display to the user an error message
  2. to give back the false value like result
The CheckFailed method (`Message of error') writes the text chain that receives as parameter in the information window (Infolog) and gives back the false value. Therefore, by means of the use of this method, we obtained simultaneously both objective.
Example of use of CheckFailed
Boolean checkSomething ()
{
Boolean ret;
if (! something)
{
ret = checkFailed (`Something is wrong');
}
return ret;
}
We could use the previous structure, but cases exist in which it interests to us to verify the same Something condition, present in the CheckSomething method (), without presenting/displaying no message to the user. In this case we would need an additional method, that verified the condition but that it did not show any message.
Nevertheless, this would not be very efficient, because we would be duplicating the verification code, therefore is more recommendable to create a called method Something (), to which we will be able to call when we want, that it will be in charge to make this verification.
We will have, in addition, to change the CheckSomething method (), so that it makes a call to this new method. The CheckSomething method () we will use it solely when we want to show a message the user.
Example of complete validation
Boolean something ()
{
if (! something)
{
return false;
}
return true;
}
Boolean checkSomething ()
{
Boolean ret;
if (! something ())
{
ret = checkFailed (`Something is wrong');
}
return ret;
}
  1. We can consider a standard of nomenclature of Axapta, the use of the Check area code, in the name of all those methods that make a call to the global method CheckFailed (). Of this form we will know what methods present/display messages in the Infolog window.

Used methods of system more

Next we are going to describe some of the used methods more in the tables, that by their importance deserve a treatment something more exhaustive. The examples of the methods have been obtained from the CustTable table.
InitValue
The InitValue method is executed when we added a new registry. Also it is called automatically from the forms. Therefore, we will use the method to assign initial values or by defect in a new registry.
Example
void initValue ()
{
CustParameters custParameters;
super ();
this.languageId = CustParameters:: languageId ();
this.currency = CompanyInfo:: find () .currencyCode;
}
It is necessary to indicate that the call to the super method () does not do anything.
Insert
The Insert method is executed when a new registry in the table is introduced. It is very important to assure any related transaction to assure integrity the data base. The techniques of control of transactions will be seen in a later chapter.
Example
void insert ()
{
this.setNameAlias ();
super ();
}
If the registry cannot be inserted in the table, the call to the super method () gives back an error.
Update
The Update method is executed before modifying an existing registry in the table. In this case, also it is very important to control any related transaction to assure integrity the data base.
Example
void update ()
{
CustTable this_Orig = this.orig ();
ttsbegin;
this.setNameAlias ();
super ();
this.setAccountOnVend (this_Orig);
if (this_Orig.custGroup! = this.custGroup)
ForecastSales:: setCustGroupId (this.accountNum,
this_Orig.custGroup,
this.custGroup);
ttscommit;
}
In the example the method is used orig (). This one method gives access us to the registry before the update.
Delete
The method delete is executed when a registry is eliminated. It is very important to assure any related transaction to assure integrity to us the data base.
Let us suppose two related tables calls TableA and TableB. If in TableA we have defined a DeleteAction of type cracked (Cascade) with respect to TableB, when a registry ofTableA erases erase the registries related in TableB.
For yield reasons, one is due to avoid to write code in the Delete method of these related tables (in the example, TableB). If code has not been added, the cascade erasures can be made quickly by the system database manager using directly instructions of erasure SQL.
Nevertheless, if we added code in those tables (what it can be necessary in some occasions), the system creates an instruction while select and executes the Deletemethod in all the tables related daughters. Of this form the yield is minor that when we directly used instructions of erasure in SQL.

what is the difference between index and indexhint in select statement.


While fetching data from the database we use select statement and for better performance in data fetching we use an index/indexhint.

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

Index hint: it force the DB to use that index for fetch the data whether it is right choice or not.

Monday 22 July 2013

Accessible Reports for Enterprise Portal




Only a subset of the SSRS reports that are included with Microsoft Dynamics AX can be accessed from Enterprise Portal. Use the following guidelines to help you determine which reports can be used on Enterprise Portal pages.
  • A menu item is required to access SSRS reports. The ObjectType property for the menu item must be SSRSReport for the report that you want to use in Enterprise Portal.
  • Reports that are based on a controller class cannot be accessed from Enterprise Portal. The menu item for a report based on a controller class has the ObjectType property set to Class.
The the SSRS Report We Part  lists the reports that can be used in Enterprise Portal. Any reports that cannot be used are excluded from the list.
Even though a report may be listed in the Report web part, it may not have been designed specifically for use in Enterprise Portal. You may have to create a separate design for the report that is more suitable for use in Enterprise Portal

Saturday 20 July 2013

Sequence of calling form methods in AX 2012


This gives the information of method calls in the form level while
1. Opening the Form.
2. Creating/Updating/Deleting the record in the Form.
3. Closing the Form.

Sequence of Methods calls while opening the Form

Form --- init ()
Form --- Datasource --- init ()
Form --- run ()
Form --- Datasource --- execute Query ()
Form --- Datasource --- active ()

Sequence of Methods calls while closing the Form

Form --- canClose ()
Form --- close ()

Sequence of Methods calls while creating the record in the Form

Form --- Datasource --- create ()
Form --- Datasource --- initValue ()
Table --- initValue ()
Form --- Datasource --- active ()

Sequence of Method calls while saving the record in the Form

Form --- Datasource --- ValidateWrite ()
Table --- ValidateWrite ()
Form --- Datasource --- write ()
Table --- insert ()

Sequence of Method calls while deleting the record in the Form

Form --- Datasource --- validatedelete ()
Table --- validatedelete ()
Table --- delete ()
Form --- Datasource --- active ()

Sequence of Methods calls while modifying the fields in the Form
Table --- validateField ()
Table --- modifiedField ()

Monday 24 June 2013

Shortcut keys in AX 2012


Impotent Keys:::>>

Ctrl+W = It shows Work space window
Ctrl+D  = AOT(Application Object Tree)
Ctrl+N  = Enter a record in a Table
Alt+W  =  Windows
Ctrl+Shift+P = Projects


Breakpoints
Command
Shortcut key
Remove all breakpoints.
CTRL+SHIFT+F9
Insert or remove a breakpoint.
F9
Enable or disable a breakpoint.
CTRL+F9
Open the Breakpoints dialog.
SHIFT+F9

Compilation and Help
Command
Shortcut key
Open the Scripts menu.
Scripts icon
Open Help.
F1
Show method parameter help.
CTRL+SHIFT+SPACEBAR
Execute the current job.
F5
Compile.
F7
Compile and close a method.
F8
Stop method execution (break).
CTRL+BREAK
Insert a file.
CTRL+ALT+H

Delete
Command
Shortcut key
Delete from the cursor to the end of the line.
Use SHIFT+END to select to end of line and then DELETE
Delete word to the right of the cursor.
CTRL+DELETE
Delete the word to the left of the cursor.
CTRL+BACKSPACE
Delete the current line.
CTRL+X (with cursor in line, no selection)

Edit
Command
Shortcut key
Insert script.
<SCRIPT NAME>
Insert document header.
///
Comment selection.
CTRL+E, C
Uncomment selection.
CTRL+E, U
Convert selection to lowercase.
CTRL+SHIFT+U
Convert selection to uppercase.
CTRL+U
Display all methods and properties for a selected class.
CTRL+SPACEBAR
Copy selection.
CTRL+C (with text selected)
Copy line.
CTRL+C (with cursor in line, no selection

Find and Replace
Command
Shortcut key
Open the Find dialog.
CTRL+F
Open the Replace dialog.
CTRL+R
Start incremental search..
CTRL+I
Move to next incremental search match in method.
CTRL+I
Reverse the incremental search direction.
CTRL+Shift+I
Remove a character from the incremental search string.
BACKSPACE
Stop the incremental search.
ESC

Go To
Command
Shortcut key
Go to a specific line.
CTRL+G
Go to the next page.
PAGE UP
Go to the previous page.
PAGE DOWN
Go to the top of the code.
CTRL+HOME
Go to the bottom of the code.
CTRL+END
Go to the start of line.
HOME
Go to the end of line.
END
Move one word to the left.
CTRL+LEFT ARROW
Move one word to the right.
CTRL+RIGHT ARROW
Go to the method definition.
F12
Go to the next error message.
F4

Lookup
Command
Shortcut key
Look up a label.
CTRL+ALT+SPACEBAR
Show label text.
CTRL+L
Look up a definition.
F12
Show the syntax of a method or property.
CTRL+SPACEBAR

Save
Command
Shortcut key
Save the selected text to a separate file.
ALT+S
Close the current TAB, discarding all changes since the last save.
F6
Close and save the current code editor window.
F8
Close the current window.
CTRL+F4

Select
Command
Shortcut key
Select all.
CTRL+A
Cancel a selection.
ESC
Select columns.
ALT+MOUSE SELECT
Select a line.
ALT+L
Select one word to the left.
CTRL+SHIFT+LEFT ARROW
Select one word to the right.
CTRL+SHIFT+RIGHT ARROW
Select text from the cursor to the start of the line.
SHIFT+HOME
Select text from the cursor to the end of the line.
SHIFT+END
Select the previous page.
SHIFT+PAGE UP
Select the next page.
SHIFT+PAGE DOWN
Select text from the cursor to the top of the code.
CTRL+SHIFT+HOME
Select text from the cursor to the bottom of the code.
CTRL+SHIFT+END
Indent the selected text.
TAB
Remove indentation.
SHIFT+TAB
Select area/column/block
ALT+MOUSE SELECT
Cancel selection
ESC
Show white space
CTRL+SHIFT+S

Undo and Redo
Command
Shortcut key
Undo the last action.
CTRL+Z (previous ten actions)
Redo the last action after an Undo.
CTRL+Y (previous ten actions)

AOT
Command
Shortcut key
Open the AOT
CTRL+D
Open a new Development Workspace
CTRL+SHIFT+W
Open a new Application Workspace
CTRL+W
Save all
CTRL+SHIFT+S
Select all application objects in a node
Select one or more application objects under a top-level node, and then press CTRL+A
Open the editor for an application object
CTRL+SHIFT+F2
Open the editor for a query or table
CTRL+O
Open the Comparison tool
Select one or more application objects, and then press CTRL+G
Compile an application object
F7
Go to the previous node
UP ARROW
Go to the next node
DOWN ARROW
Move the node up
ALT+UP ARROW
Move the node down
ALT+DOWN ARROW
Expand the current node
RIGHT ARROW
Collapse the current node
LEFT ARROW
Select multiple items
CTRL
Cancel the selection of an additional item
CTRL+SPACEBAR
Open the Properties sheet
ALT+ENTER
Open the Import dialog box
Select one or more application objects, and then press CTRL+SHIFT+I
Open the Find dialog box to find an element in the AOT
CTRL+F
Open the Help documentation for an element in the AOT
F1