MICROSOFT DYNAMICS AX 2009 DEVELOPMENT COOKBOOK PDF
Microsoft Dynamics AX Programming Getting cittadelmonte.info · Add files via upload, 2 years ago. Microsoft Dynamics AX Development cittadelmonte.info In December , he released his first book, Microsoft Dynamics AX Development Cookbook, both of which are published by Packt Publishing. . know that Packt offers eBook versions of every book published, with PDF and ePub. AX Development Cookbook, cittadelmonte.info%5Chide%5CAX5% 5CeBooks%5CAXebook%20AX%cittadelmonte.info
|Language:||English, Spanish, French|
|ePub File Size:||29.61 MB|
|PDF File Size:||19.26 MB|
|Distribution:||Free* [*Regsitration Required]|
Microsoft Dynamics. AX Development. Cookbook. Solve real-world Dynamics AX development problems with over 60 simple but incredibly effective . Microsoft Dynamics AX Development Cookbook. As a Dynamics AX developer, your responsibility is to deliver all kinds of application customizations . Microsoft Dynamics AX Development Cookbook Solve real-world DOWNLOAD PDF First published: December Second edition: May
I have a virtual machine with the '09 version installed. What should I start with tutorials, videos, overviews, guided tours and where do I find it? If you do a basic search, you'l find a lot of tutorials, Microsoft Learning Materials, etc. And now find the proper forum also: Please refer the following links to download pdf for different books on AX development and programming.
Chaitanya Golla responded on 17 Oct Getting Started sumitax. Sandeep Kommineni responded on 17 Oct Regards, Sandeep Kommineni. Hi, You are welcome. Please mark verified those answers which are useful for you.
Microsoft Dynamics AX 2012 Development Cookbook
Vilmos Kintera responded on 18 Oct 3: Step 1 to become a developer is learning how to use search engines to find answers on your own: Business Applications communities. Click here to login or become a member to ask questions and reply in our fourms. Offline David Singleton over 11 years ago. Up 0 Down Cancel. Offline munib over 9 years ago in reply to tamer. Getting Started" http: You are both criminals. Offline Naresh Dharanikota over 8 years ago in reply to zubair.
Offline David Singleton over 8 years ago in reply to Naresh Dharanikota. Hi try in this Blog.. Here we use the previously created DictTable and DictField type objects by calling their name methods with the DbBackend:: Sql enumeration as an argument. This ensures that we pass the name exactly how it is used in the database—some of the SQL field names are not necessary the same as field names within the application. We also use the sqlLiteral method of the previously created sqlSystem object to properly format SQL values to make sure they do not have any unsafe characters.
The results are returned into the resultSet object, and we get them by using the while statement and calling the next method until the end of the resultSet object. Note that we create an sqlPermission object of type SqlStatementExecutePermission here and call its assert method before executing the statement. This is required in order to comply with Dynamics AX trustworthy computing requirements.
Another thing to mention is that when building direct SQL queries, special attention has to be paid to license, configuration, and security keys. Some tables or fields might be disabled in the application and may contain no data in the database. The code in this recipe can be also used to connect to the external ODBC databases. By using those classes, we can create SQL statements as objects as opposed to text.
Next, we will demonstrate how to use the SQLBuilder classes. We will create the same SQL statement as before. No ; selectExpr. It represents the object of the SQL statement. Next, we add the VendTable table to it by calling its member method addTableId. We also add DirPartyTable as a joined table.
Then, we create a number of field objects of type SQLBuilderFieldEntry to be used later and two ranges to show only this company account and only active vendor accounts. We use addSelectFieldEntry to add two fields to be selected.
Here we use the previously created field objects. The SQL statement is generated once the getExpression method is called, and the rest of the code is the same as in the previous example. Running the class would give us results, which are exactly similar to the ones we got before. Enhancing the data consistency check It is highly recommended to run the standard Dynamics AX data consistency check from time to time, that is located in System administration Periodic Database Consistency check, to check the system's data integrity.
This function finds orphan data, validates parameters, and does many other things, but it does not do everything. The good thing is that it can easily be extended to match different scenarios. In this recipe, we will see how we can enhance the standard Dynamics AX consistency check to include more tables in its data integrity validation. Open Fixed assets Setup Fixed asset posting profiles and under the Ledger accounts group, create a new record with the newly created value model for any of the posting types: Now, we have a non-existing value model in the fixed asset posting settings.
Open System administration Periodic Database Consistency check, select the newly created Fixed assets option in the Module drop-down, and click OK to run the check: Now the message displayed in the Infolog should complain about the missing value model in the fixed asset posing settings: The consistency check in Dynamics AX validates only the predefined list of tables for each module.
The system contains a number of classes derived from SysConsistencyCheck. For example, the CustConsistencyCheck class is responsible for validating the Accounts receivable module, LedgerConsistencyCheck—for General ledger, and so on. The following methods were created: Here we use the kernelCheckTable member method, which validates the given table. The classes we just mentioned can only be executed from the main Consistency check form.
Individual checks could also be invoked as stand-alone functions. We just need to create an additional method to allow running of the class: It allows the creation of all kinds of structured documents to exchange between systems. For example, user profiles can be exported as XML files. It is an infrastructure that allows exposing business logic or exchanging data with other external systems. The communication is done by using XML formatted documents.
By using the existing XML framework application classes prefixed with Axd, you can export or import data from or to the system in an XML format to be used for communicating with external systems. It is also possible to create new Axd classes using the AIF Document Service Wizard from the Tools menu to support the export and import of newly created tables.
Basically, those classes are wrappers around the System. XML namespace in the. NET framework. In this recipe, we will create a new simple XML document by using the latter classes, in order to show the basics of XML. We will create the file with the data from the chart of the accounts table and will save it as an XML file. RecId ; nodeXml. MainAccountId ; nodeTable. Name ; nodeTable. Run the class. The XML file accounts. Then we create its root node named xml using the createElement method, and add the node to the document by calling the document's appendChild method.
Next, we go through the MainAccount table and do the following for each record: Create a new XmlElement node, which is named exactly as the table name, and add this node to the root node. Create a node representing the account number field and its child node representing its value. The account number node is created using createElement , and its value is created using createTextNode.
Add the account number node to the table node. Create a node representing the account name field and its child node representing its value. Add the account name node to the table node. Finally, we save the created XML document as a file.
In this way, we can create documents having virtually any structure. In this recipe, we will continue using the System. XML wrapper application classes.
We will create a new class which reads XML files and displays the content onscreen. As a source file, we will use the previously created accounts. Use the document created in the previous recipe: The Infolog should display the contents of the accounts.
In this recipe, we first create a new XmlDocument. We create it from the file and hence we have to use its newFile method. Then we get all the document nodes of the table as XmlNodeList. We also get its first element by calling the nextNode method.
Next, we loop through all the list elements and do the following: Get an account number node as an XmlElement. Get an account name node as an XmlElement. Display the text of both nodes in the Infolog. Get the next list element. In this way, we retrieve the data from the XML file. A similar approach could be used to read any other XML file. Although nowadays modern systems use XML formats for data exchange, CSV files are still popular because of the simplicity of their format.
Normally, the data in the file is organized so one line corresponds to one record, and each line contains a number of values normally separated by commas. Record and value separators could be any other symbol, depending on the system requirements. In this recipe, we will learn how to create a custom comma-separated file from code. We will export a list of ledger accounts—the CSV format. MainAccountId, mainAccount. Name]; file.
A new file named accounts. Open that file with Notepad or any other text editor to view the results: In the variable declaration section of the main method of the newly created CreateCommaFile class, we define a name for the output file, along with other variables. Normally, this should be replaced with a proper input variable. It accepts two parameters—filename and mode. If a file with the given name already exists, then it will be overwritten.
In order to make sure that a file is created successfully, we check if the file object exists and its status is valid, otherwise we show an error message. In multilingual environments, it is better to use the CommaTextIo class. It behaves the same way as the CommaIo class does plus it supports Unicode, which allows us to process data with various language-specific symbols. Finally, we loop though the MainAccount table, store all account numbers and their names in a container, and write them to the file using the writeExp method.
In this way, we create a new comma-separated value file with the list of ledger accounts. You probably already noticed that the main method has the client modifier, which forces its code to run on the client. When dealing with large amounts of data, it is more effective to run the code on the server. In order to do that, we need to change the modifier to server. The following class generates exactly the same file as before, except that this file is created in the folder on the server's file system: Finally, we call CodeAccessPermission:: It is probably the most simple integration approach, when one system generates CSV files in some network folder and another one reads those files at specified intervals.
Although this is not very sophisticated real-time integration, in most cases it does the job and does not require any additional components, such as Dynamics AX Application Integration Framework or something similar.
Another well-known example is when external companies are hired to manage the payroll. On a periodic basis, they send CSV files to the finance department, which are then loaded into the General journal in Dynamics AX and processed as usual.
In this recipe, we will learn how to read CSV file from code. As an example, we will process the file created in a previous recipe.
Run the class to view the file's content, as shown in the following screenshot: As in the previous recipe, we first create a new file object using the CommaTextIo class. We also perform the same validations to make sure that the file object is correctly created, otherwise we show an error message. Finally, we read the file line by line until we reach the end of the file.
OK, meaning we have reached the file end. Inside the loop, we call the read method on the file object, which returns the current line as a container and moves the internal file cursor to the next line. File data is then simply output to the screen using the standard global info function in conjunction with the con2Str function, which converts a container to a string for displaying.
The last element of code, where the data is output, should normally be replaced by proper code that processes the incoming data. File reading, could also be executed in a similar way as file writing on a server to improve performance.
AX2009 development manuals
The modifier client has to be changed to server, and code with the FileIoPermission class has to be added to fulfil the code access security requirements.
The modified class should look similar to the following code: Date ranges are used for defining record validity between the specified dates, for example, defining employee contract dates. This feature significantly reduces the amount of time that developers spend writing code and also provides a consistent approach to implement data range fields.
This recipe will demonstrate the basics of date effectiveness. We will implement date range validation on the standard E-mail templates form. Notice the two new fields that are automatically added to the table: Add the newly created ValidFrom and ValidTo fields to the existing emailIdIdx index and change the properties shown in the following table: The index should look similar to the following screenshot: In the AOT, find the SysEmailTable form, refresh it using the Restore command which can be found in the form's right-click context menu.
Then, locate its data source named SysEmailTable and change its properties as follows: In order to test the results, navigate to Organization administration Setup E-mail templates and notice the newly created fields: Effective and Expiration columns. Try creating records with the same E-mail ID and overlapping date ranges—you will notice how the system is proposing to maintain valid date ranges: This automatically creates two new fields: ValidFrom and ValidTo that are used to define a date range.
Next, we add the created fields to the primary index where the EmailId field is used and adjust the following index's properties: The property can also be set to Gap allowing non-continuous date ranges. Finally, we adjust the SysEmailTable form to reflect the changes. We also change a few properties of the SysEmailTable data source: The default AsOfDate value could be used if we want to display only the records for the current period.
Forms with date effective records can be enhanced with an automatically-generated toolbar for filtering the records. This can be done with the help of the DateEffectivenessPaneController application class. In order to demonstrate that, let's modify the previously used SysEmailTable form and add the following code to the bottom of the form's init method: They are also used for running reports, executing user commands, validating data, and so on.
Normally, forms are created using the AOT by creating a form object and adding form controls such as tabs, tab pages, grids, groups, data fields, images, and others. Form behavior is controlled by its properties or the code in its member methods.
The behavior and layout of form controls are also controlled by their properties and the code in their member methods.
Although it is very rare, forms can also be created dynamically from the code. We start with building Dynamics AX dialog, and explaining how to handle its events.
The chapter will also show how to build a dynamic form, how to add a dynamic control to existing forms, and how to make a modal form. This chapter also discusses the usage of a splitter and a tree control, how to create a checklist, save last user selections, and other things.
Creating a dialog Dialogs are a way to present users with a simple input form. They are commonly used for small user tasks, such as filling in report values, running batch jobs, presenting only the most important fields to the user when creating a new record, and so on. The application class Dialog is used to build dialogs.
A common way of using dialogs is within the RunBase framework classes, where user input is required. In this example, we will demonstrate how to build a dialog from the code using the RunBase framework class. The dialog will contain customer table fields shown in different groups and tabs for creating a new record. There will be two tab pages, General and Details. The first page will have Customer account and Name input controls.
The second page will be divided into two groups, Setup and Payment, with relevant fields inside each group. The actual record will not be created, as it is out of scope of this example.
However, for demonstration purposes, the information specified by the user will be displayed in the Infolog. In order to test the dialog, run the class. The following form should appear with the General tab page open initially: Click on the Details tab page to see the following screen: Enter some information into the fields and click OK. The results are displayed in the Infolog: First, we create a new class CustCreate. By extending it from RunBase, we utilize a standard approach of developing data manipulation functions in Dynamics AX.
The RunBase class defines a common structure and automatically adds additional controls, such as OK and Cancel buttons to the dialog. Then we declare class member variables, which will be used later. Variables of the DialogField type represent user input fields. Other variables are used to store the actual user input. RunBase requires those two methods to be implemented in all its subclasses. The layout of the actual dialog is constructed in the dialog member method. Here, we define local variables for the dialog itself—tab pages and groups.
Those variables, as opposed to the dialog fields, do not store any value for further processing. The super of the RunBase framework creates the initial dialog object for us.
The object is created using the Dialog application class. The class actually uses an AOT form named Dialog as a base, automatically adds the relevant controls, including OK and Cancel buttons, and presents it to the user as a dialog. Additional controls are added to the dialog by using the addField , addGroup , and addTabPage methods.
There are more methods to add different types of controls, such as addText , addImage , addMenuItemButton , and others. All controls have to be added to the dialog object directly. Adding an input control to groups or tabs is done by calling addField right after addGroup or addTabPage. In the previous example, we added tab pages, groups, and fields in logical sequence top down.
Notice that it is enough only to add a second tab page, the first one labeled General is added automatically by the RunBase framework. Values from the dialog controls are assigned to variables by calling the value member method of the DialogField class. If a dialog is used within the RunBase framework, as in this example, the best place to assign dialog control values to variables is the getFormDialog member method.
RunBase calls this method right after the user clicks OK. The main processing is done in the run method. For demonstration purposes, this class only shows the user input the Infolog. In order to make this class runnable, the static method main has to be created. Here, we create a new CustCreate object, invoke user dialog by calling the prompt method, and once the user finishes entering customer details by clicking OK, we call the run method to process the data.
See also In this chapter: For example, if the user marks the Show filter checkbox, then another field, Filter, appears or becomes enabled. In AOT forms, this can be done by using the input control modified event. However, if this feature is required on runtime dialogs, handling events are not that straightforward. Very often, existing dialogs have to be modified to support eventing. The easiest way of doing that is of course to convert a dialog into an AOT form. However, in cases when the existing dialog is complex enough, probably a more cost effective solution would be to implement dialog event handling instead of converting it into an AOT form.
Event handling in dialogs is not as flexible as in AOT forms, but in most cases it does the job. In this recipe, we will create a dialog very similar to the previous one, but instead of entering the customer number, we will be able to select it from the list. Once the customer is selected, the rest of the fields will be completed automatically by the system from the customer record.
CustGroup ; fieldCurrency. Currency ; fieldPaymTermId. PaymTermId ; fieldPaymMode. Run the class, select any customer from the list, and move the cursor to the next control. Notice how the rest of the fields were populated automatically with the customer information: When you click on the Details tab page, you will see the details as shown in the following screenshot: The new class CustSelect is actually a copy of the CustCreate class from the previous recipe with a few changes.
In its class declaration, we leave all DialogField declarations and remove the rest of the variables. In the dialog member method, we call the allowUpdateOnSelectCtrl method with the argument true to enable input control event handling. We also disable all controls apart from the Customer account by calling enable with parameter false for each control. The member method dialogSelectCtrl of the RunBase class is called every time the user modifies any input control in the dialog.
It is the place where we have to add all the required code to ensure that, in our case, all controls are populated with the correct data from the customer record, once the Customer account is chosen.
The static main method ensures that we can run this class. Usage of the dialogSelectCtrl method sometimes might appear a bit limited as this method is only invoked when the dialog control loses its focus.
Also, no other events can be controlled, and it can become messy if events on multiple controls need to be processed. The Dialog class does not provide direct access to the underlying form's event handling functions, but we can easily access the form object within the dialog. Although we cannot create the usual event handling methods on runtime form controls, we can still control this in a slightly different way. Let us modify the previous example to include more events.
We will add an event on the second tab page, which is triggered once the page is activated. First, we have to override the dialogPostRun method on the CustSelect class: We also pass the CustSelect object as an argument to the controlMethodOverloadObject method to make sure that the form knows where the overloaded events are located.
Now run the class again, and select the Details tab page. The message should be displayed in the Infolog. Before creating such methods, we first have to get the name of the runtime control. This is because the dialog form is created dynamically, and the system defines control names automatically without allowing the user to choose them.
In this example, we have to temporarily add the following code to the bottom of the dialog , which displays the name of the Details tab page control.
GitHub - dhrumeshgandhi/AX_Books: Dynamics AX Books
Just replace the following code: Note that this approach may not work properly if the dialog contains an automatically-generated query. In such cases, control names will change if the user adds or removes query ranges. Using this approach, it is possible to achieve a high level of complexity.
However, in a number of cases, it is required to have forms created dynamically. In the standard Dynamics AX application we can see that application objects, such as the Table browser form, various lookups, or dialogs, are built dynamically. In this recipe, we will create a dynamic form. In order to show how flexible it can be, we will replicate the layout of the existing Customer groups form located in the Accounts receivable module.
It can be opened from Accounts receivable Setup Customers. SimpleList ; design. ActionPane, 'ActionPane' ; actionPane. CommandButton, 'NewButton' ; cmdNew. TextAndImageLeft ; cmdNew. EmbeddedResource ; cmdNew. Yes ; cmdNew. CommandButton, 'NewButton' ; cmdDel. TextAndImageLeft ; cmdDel. EmbeddedResource ; cmdDel. Yes ; cmdDel. MenuFunctionButton, 'Posting' ; mibPosting. No ; mibPosting. No ; mibForecast. Group, 'Body' ; grpBody. ColumnHeight ; grpBody. Grid, "Grid" ; grid.
ColumnWidth ; 69 Working with Forms grid. ColumnHeight ; grid. In order to test the form, run the class. Notice that the form is similar to the one in Accounts receivable Setup Customers Customer groups: We start the code by declaring some variables. Note that most of them begin with FormBuild, which is part of a set of the application classes used for building dynamic forms.
Each of these types correspond to the control types manually used when building forms in the AOT. Right after the variable declaration, we create a dictTable object based on the CustGroup table. We will use this object several times later in the code.
Then we create a new form object and set its AOT name by calling the following code: The form should have a data source, so we add one by calling the addDataSource method on the form object and providing the previously created dictTable object. The first thing to do is to add a strip action pane with its buttons: Just to follow best practice, we place the grid inside of a Group control: ColumnWidth ; grid.
ColumnHeight ; Next, we add a number of grid controls pointing to the relevant data source fields by calling addDataField on the grid object. The last thing is to initialize and run the form. Here we use a recommended approach to create and run forms using the globally available classFactory object. Adding a form splitter In Dynamics AX, more complex forms consist of one or more sections.
Each section may contain grids, groups or any other element. In order to maintain section sizes while resizing the form, the sections are normally separated by so-called splitters. Splitters are not special Dynamics AX controls; they are group controls with the properties modified so they look like splitters. Most of the multisection forms in Dynamics AX already contain splitters. In this recipe, to demonstrate the usage of splitters, we will modify one of the existing forms that does not have a splitter.
We will modify the Account reconciliation form in the Cash and bank management module, which can be opened from Cash and bank management Bank accounts list page, by clicking on the Reconcile Account reconciliation button in the action pane, and then selecting any of the existing records and hitting the Transactions button.
In the following screenshot, you can see that it is not possible to control the sizes of each grid individually, and they are resized automatically using a fixed ratio when resizing the form: We will add a form splitter in the middle of the two grids in the mentioned form.
It will allow users to define the size of both grids to make sure the data is optimally displayed. Open the BankReconciliation form in the AOT, and in the form's design add a new Group control right after the ActionPage control with the following properties: Move the AllReconciled, Balances, and Tab controls into the newly created group.
Add a new Group control right below the Top group with the following properties: Add the following line of code to the bottom of the form's class declaration: Add the following line of code to the bottom of the form's init method: Override three methods in the Splitter group with the following code: Change the following properties of the existing BankTransTypeGroup group: Property Height Value Column height 9.
Now, to test the results, open Cash and bank management Bank accounts, select any bank account, click Reconcile Account reconciliation, choose an existing one or create a new bank statement, and click on the Transactions button.
Notice that the form now has a nice splitter in the middle, which makes the form look better and allows resizing of both grids: Normally, a splitter has to be placed between two form groups. In this recipe, to follow that rule, we need to adjust the BankReconciliation form's design. We do not want this new group to be visible to the user, so we set FrameType to None. Setting AutoDeclaration to Yes allows us to access this object from the code.
Finally, we make this group automatically expanding in the horizontal direction by setting its Width to Column width. At this stage, visual form layout does not change, but now we have the upper group ready. The BankTransTypeGroup group could be used as a bottom group with slight changes.
We change its Top behavior to Auto and make it fully expandable in the horizontal and vertical directions. The Height of the grid inside this group also has to be changed to Column height in order to fill all the vertical space.
In the middle of those two groups, we add a splitter. The splitter is nothing but another group, which looks like a splitter. This group does not hold any other controls inside, therefore, in order to make it visible we have to set the HideIfEmpty property to No. The Column width value of the property Width forces the splitter to automatically fill the form's width. After it has been declared in the form's class declaration, we instantiate it in the form's init method.
We pass the name of the splitter control, the name of the top group, and the form itself as arguments when creating it. A fully working splitter requires three mouse event handlers.
It is implemented by overriding the mouseMove , mouseDown , and mouseUp event methods in the splitter group control. In this way, horizontal splitters can easily be added to any form. Vertical splitters can also be added to forms using a very similar approach. Creating a modal form Quite often people who are not familiar with computers and software tend to get lost among open application windows. The same could be applied to Dynamics AX.
Often a user opens one form, clicks a button to open another one, and then goes back to the first one without closing the second one. Sometimes this happens intentionally, sometimes not, but the result is that the second form is hidden behind the first one and the user starts wondering why it is not possible to close or edit the first form.
In other words, the second form always stays on top of the first one until closed. In this recipe, we will do exactly that. As an example, we will make the Create sales order form a modal window. Property WindowType Value Popup 2. In order to test, open Sales and marketing Sales orders All sales orders, and start creating a new order. Notice that now the sales order creation form always stays on top: The design of the form has a WindowType property, which is set to Standard by default.
In order to make a form behave as a modal window, we have to change it to Popup. Such forms will always stay on top of the parent form. We already know that some of the Dynamics AX forms are created dynamically using the Dialog class. If we look deeper into the code, we could find that the Dialog class actually creates a runtime form.
This means that we can apply the same principle—change the relevant form's design property. The following code could be added to the Dialog object and would do the job. The format is given as follows: Popup ; Here we get a reference to the form's design, by first using the dialogForm method of the dialog object to get a reference to the DialogForm object, and then we call buildDesign on the latter object.
Finally, we set the design property by calling its windowType with an argument FormWindowType:: Every runtime form inherits that class; therefore the class could be used to override some of the common behavior for all Dynamics AX forms.
For example, form background color could be changed depending on some parameters, some controls could be hidden or added depending on specific circumstances, and so on. ButtonGroup, 'ButtonGroup' ; btngrp.
- HACKING HOT POTATOES THE COOKBOOK PDF
- ICEFACES 1.8 NEXT GENERATION ENTERPRISE WEB DEVELOPMENT PDF
- COMPTIA SERVER+ 2009 EDITION PDF
- GIMP 2.6 COOKBOOK PDF
- THE AGE OF SUSTAINABLE DEVELOPMENT BOOK
- MICROSOFT 70 480 DUMPS PDF
- HTTP DEVELOPERS HANDBOOK PDF
- ENGINEERING MECHANICS STATICS DYNAMICS PDF
- ANDROID STUDIO COOKBOOK PDF
- THE HEIR CHRONICLES EBOOK
- LA MAGIE DE VOIR GRAND PDF
- HANUMAN CHALISA LYRICS IN TELUGU PDF