EXTENDING MICROSOFT DYNAMICS AX 2012 COOKBOOK PDF
Extending Microsoft Dynamics AX. Cookbook. Dynamics AX is a great application for businesses, but if you are just using it to track customers, sales. Aug 26, Extending Microsoft Dynamics AX Cookbook. This is a brilliantly accessible book, packed with practical examples, that's perfect for. Cookbook, and then in May , its second edition, Microsoft Dynamics AX In , Palle wrote a chapter titled Extending Microsoft Dynamics AX for Inside . Packt offers eBook versions of every book published, with PDF and ePub.
|Language:||English, Spanish, Indonesian|
|ePub File Size:||MB|
|PDF File Size:||MB|
|Distribution:||Free* [*Regsitration Required]|
This is a brilliantly accessible book, packed with practical examples, that's perfect for business professionals who want to make more of the advanced features of. Extending Microsoft Dynamics AX Cookbook Murray Fife Chapter No. 10 " Web Services and Forms" In this package, you will find: A Biography of the. Microsoft Dynamics AX Development CookbookSolve real-world Microsoft Dynamics AX development problems with over.
Adding a document handling note It is good practice to add some kind of note to the record when doing data renaming, merging, or any other data manipulation task, whether it's manual or automatic.
Dynamics AX allows adding a note or a file to any record by using the so-called Document handling feature.
Microsoft Dynamics AX Development Cookbook
By default, it is enabled for all tables, but can be restricted to fewer tables by changing its configuration parameters. Document handling can be accessed from the form action pane by clicking on the Attachments button, choosing Document handling from the File Command menu or selecting the Document handling icon from the status bar. Document handling allows adding text notes or files to any currently selected record.
Dynamics AX also allows adding document handling notes from the code too, which helps developers or consultants to add additional information when doing various data migration or conversion tasks. In this recipe, we will add a note to a vendor account.
Open Accounts payable Common Vendors All vendors, and locate the vendor account that has to be updated: 19 Processing Data 2. RefCompanyId docuRef. RefTableId docuRef.
RefRecId docuRef. TypeId docuRef. Name docuRef. Notes docuRef. TableId; vendTable. RecId; 'Note'; 'Imported'; 'This vendor was imported. Run the job to create the note. Click on the Attachments button in the form's action pane or select Document handling from the File Command menu to view the note added by our code: 20 Chapter 1 How it works In our recipe, we will set those fields to the vendor company ID, vendor table ID, and vendor account record ID, respectively.
Next, we will set note type, name, and description, and insert the document handling record. In this way, we will add a note to the record. The code in this recipe could also be added to a separate method for further reuse. Using a normal table as a temporary table Standard Dynamics AX contains numerous temporary tables, which are used by the application and could be used in custom modifications too.
Although new temporary tables can also be easily created using the AOT, sometimes it is not effective. One of the cases could be when the temporary table is very similar or exactly the same as an existing one. The goal of this recipe is to demonstrate an approach for using standard non-temporary tables to hold temporary data.
As an example, we will use the vendor table to insert and display a couple of temporary records without affecting the actual data. AccountNum, vendTable. Run the class and check the results: How it works The key method in this recipe is in the setTmp method. It is available on all tables, and it declares the current table instance to behave as a temporary table in the current scope.
So in this recipe, we will first call the setTmp method on the vendTable table to make it temporary in the scope of this method. That means any data manipulations will be lost once the execution of this method is over and actual table content will not be affected. Next, we will insert a couple of test records. Here, we use the doInsert method to bypass any additional logic, which normally resides in the table's insert method.
The last thing to do is to check for newly created records by listing the vendTable table. We can see that although the table contains many actual records, only the ones which we inserted were displayed in the Infolog. Additionally, the two we inserted do not appear in the actual table records. Copying a record One of the tasks often used when manipulating data is record copying.
For various reasons, an existing record needs to be modified and saved as a new one. The most obvious example could be when a user requires a function that allows him or her to quickly duplicate records on any of the existing forms.
In this recipe, we will explain the usage of the table's data method, the global buf2buf function, and their differences.
As an example, we will copy one of the existing ledger account records into a new one. Open General ledger Common Main accounts, and find the account to be copied. In this example, we will use 2. Open General ledger Common Main accounts again, and notice that there are two identical records now: How it works In this recipe, we have two variables—mainAccount1 for original record and mainAccount2 for the new one.
Next, we will copy it to the new one. Here, we will use the data table member method, which copies all data fields from one variable to another.
After that, we will set a new ledger account number, which is a part of a unique table index and must be different. Finally, we call the insert method on the table, if validateWrite is successful. In this way, we have created a new ledger account record, which is exactly the same as the existing one apart from the account number.
There's more As we saw before, the data method copies all table fields, including system fields such as record ID, company account, created user, and so on.
Most of the time, it is OK because when the new record is saved, the system fields are overwritten with the new values. However, this function may not work for copying records across companies. In this case, we can use another function called buf2Buf.
It is very similar to the table's data method with one major difference. The buf2Buf function copies all data fields excluding the system ones. We can also see that this function is slower than the internal data method, as it checks and copies each field individually. Normally, queries are stored in the AOT, but they can also be dynamically created from code. This is normally done when visual tools cannot handle complex and dynamic queries. In this recipe, we will create a query dynamically from the code to retrieve project records from the project management module.
We will select only the projects of type fixed price, starting with 2 in its number and containing at least one hour transaction. ProjId, projTable. Name, projTable. Run the job and the following screen should appear: How it works First, we create a new query object.
Next, we add a new ProjTable data source to the query object by calling its addDataSource member method. The method returns a reference to the QueryBuildDataSource object—qbds1. Here, we call the addSortField method to enable sorting by project name. The following two blocks of code create two ranges. The first is to show only projects of type fixed price and the second one is to list only records, where the project number starts with 2.
Those two filters are automatically added together using the SQL and operator. The range value is set by calling value on the QueryBuildRange object itself. It is a good practice to use the queryValue function to process values before applying them as a range.
Microsoft Dynamics AX
More functions such as queryNotValue , queryRange , and so on can be found in the Global application class. Note that these functions are actually shortcuts to the SysQuery application class, which in turn have even more interesting helper methods that might be handy for every developer. Adding another data source to an existing one connects both data sources using the SQL join operator. In this example, we are displaying projects that have at least one posted hour line. We start by adding the ProjEmplTrans table as another data source.
Next, we need to add relations between the tables. If relations are not defined on tables, we will have to use the addLink method with relation field ID numbers. In this example, relations on the tables are already defined so it is enough only to enable them by calling the relations method with true as an argument. Calling joinMode with JoinMode::ExistsJoin as a parameter ensures that a record from a parent data source will be displayed only if the relation exists in the attached data source.
The last thing to do is to create and run the queryRun object and show the selected data on the screen. It is worth mentioning a couple of specific cases when working with query objects from code.
One of them is how to use the or operator and the other one is how to address array fields. Using the OR operator As you have already noted, regardless of how many ranges are added, all of them will be added together using the SQL and operator. In most cases it is fine, but sometimes complex user requirements demand ranges to be added using SQL or. There might be a number of workarounds, such as using temporary tables or similar tools, but we can use the Dynamics AX feature that allows passing a part of raw SQL string as a range.
In this case, the range has to be formatted in a similar manner as a fully qualified SQL where clause, including field names, operators, and values. The expressions have to be formatted properly before using them in a query. Here are some of the rules: ff The expression must be enclosed within single quotes.
Let us replace the code from the previous example: qbr1. An example in a standard application could project sorting based on a ProjSortingId extended data type. Find Ebooks and Videos by Technology Android. Packt Hub Technology news, analysis, and tutorials from Packt. Insights Tutorials.
News Become a contributor. Categories Web development Programming Data Security. Subscription Go to Subscription. Subtotal 0. Title added to cart. Subscription About Subscription Pricing Login.
Features Free Trial. Search for eBooks and Videos. Are you sure you want to claim this product using a token? Murray Fife August Quick links: What do I get with a Packt subscription? What do I get with an eBook? What do I get with a Video?
Frequently bought together. Learn more Add to cart. Paperback pages. Book Description Dynamics AX is built on a number of foundation products from Microsoft that are used to make it bigger, better, and stronger than the average business system.
Table of Contents Chapter 1: Extending Out with SharePoint.
Microsoft Dynamics AX Development Cookbook
Chapter 2: Reports and Dashboards. Creating a Power View report via the PowerPivot gallery. Chapter 3: Dashboards, Charts, and Scorecards. Using Decomposition Trees to drill into the analytical charts. Chapter 4: Communication and Collaboration.
Using Lync to collaborate with other users directly from Dynamics AX. Chapter 5: Using Cases to Manage Incidents and Requests. Chapter 6: Organizing Your Workflows. Chapter 7: Reporting in Office. Chapter 8: Talking to the Outside World. Adding login accounts for customers in Active Directory. Adding images and presentation information to product catalogs.
Chapter 9: Creating Help. Chapter Web Services and Forms. Role Center Personalization and Customization. What You Will Learn Easily create attractive dashboards and reports using Performance Point, PowerView and Excel Improve and maximize the potential of user communication and collaboration with Outlook and Lync Create and configure roles centers for your users Build personal portals and document libraries within SharePoint Create a streamlined organization through workflows Build new help files specific to your business Develop personalized and customized screens.
Authors Murray Fife. Like most people he has paid his dues as a developer, as an implementation consultant, and a trainer. He has a hard-to-find blend of technical and interpersonal skills and spends his days working with companies solving their problems with the Microsoft suite of products, specializing in Dynamics AX solutions. Read More. Read More Reviews.
Recommended for You. All Rights Reserved.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. In this recipe, we will explain the usage of the table's data method, the global buf2buf function, and their differences. After that, we will set a new ledger account number, which is a part of a unique table index and must be different.
Working with Forms 57 Introduction 57 Creating a dialog 58 Handling a dialog event 63 Building a dynamic form 67 Adding a form splitter 72 Creating a modal form 77 Modifying multiple forms dynamically 79 Storing last form values 82 Using a tree control 85 Table of Contents Building a checklist Adding the View details link 97 Chapter 3: The most obvious example could be when a user requires a function that allows him or her to quickly duplicate records on any of the existing forms.
We will add small icons in front of each node.