“How Do I” Videos — Dynamics AX
“How Do I” Videos — Dynamics AX Read full post at Dynamics AX Developer Centerhttp://msdn.microsoft.com/en-us/dynamics/ax/cc507280 “How Do I” Videos — Dynamics AX On this page you will find videos designed for all Microsoft Dynamics AX developers, from the novice to the professional. New videos are added regularly, so check back often. Forms Series This how-to video series is focused on forms and their features in Microsoft Dynamics AX. How Do I: Link Parent and Child Forms by Using Dynamic Links?(6 minutes, 47 seconds) Enterprise Portal Series This how-to video series is focused on Enterprise Portal and its features in MicrosoftDynamics AX. How Do I: Use Record Context in Enterprise Portal?(14 minutes, 51 seconds) How Do I: Create a Simple List Page in Enterprise Portal?(4 minutes, 52 seconds) How Do I: Create a Simple Task Page in Enterprise Portal?(4 minutes, 39 seconds) How Do I: Create a Simple Wizard Page in Enterprise Portal?(7 minutes, 39 seconds) How Do I: Call an X++ Class From an EP User Control?(7 minutes, 26 seconds) How Do I: Add a Range to a Dataset in an EP List Page?(5 minutes, 13 seconds) Enterprise Portal Deployment Webinar(48 minutes, 04 seconds) Enterprise Portal Development Webinar(73 minutes, 49 seconds) How Do I: Set Up EP in an NLB Cluster?(11 minutes, 34 seconds) User Interface Series This how-to video series is focused on user interface features in Microsoft Dynamics AX. How Do I: Navigate the Client User Interface?(8 minutes, 53 seconds) Integration Series This how-to video series is focused on development features that enable integration with Microsoft Dynamics AX including Application Integration Framework (AIF) and Business Connector. How Do I: Create a Custom AIF Pipeline Component?(7 minutes, 28 seconds) How Do I: Integrate an Application Using .NET Business Connector?(4 minutes, 46 seconds) How Do I: Send the Chart of Accounts Electronically?(6 minutes, 04 seconds) Database Series This how-to video series is focused on the database features in Microsoft Dynamics AX. How Do I: Use X++ SQL Select Statements?(5 minutes, 54 seconds) Reporting Series This how-to video series is focused on reporting features in Microsoft Dynamics AX. How Do I: Create a Report Using MorphX?(7 minutes, 28 seconds) How Do I: Troubleshoot Role Center Reporting Errors?(11 minutes, 18 seconds) How Do I: Debug Microsoft Dynamics AX SSRS Reports with Visual Studio 2008?(9 minutes, 45 seconds) Miscellaneous Series This how-to series contains videos about various features in Microsoft Dynamics AX and related content. How Do I: Navigate the Developer Center?(3 minutes, 50 seconds) How Do I: Apply a Hotfix to an Installation?(7 minutes, 46 seconds) *Shared from Dynamics AX Developer Center.
How to add financial dimension on forms inside AX 2012
Add financial dimension on forms inside AX 2012 1. Perform a) Open AOT>>Data Dictionary>>Extended Data Types type/select DimensionDefault and drag it in table which will be used further as a datasource in form where you have to show the Dimensions. Do Remember that you have to drag it in table not at DataSource. b) Open Table in the Data, Dictionary which will be used as a Datasource, and create a realtion with table DimensionAttributeValueSet . c) Right Click the Relations. Select ‘New Realation’. Select properties. Set name as DimensionAttributeValueSet, Table as DimensionAttributeValueSet. d) Right Click the this newly created Relation DimensionAttributeValueSet, select New>>Normal. e) Set the properties of Normal Realtion as: Field=TheFieldwhichwillsaveDimensionNumberInYourTable Source EDT= DimensionDefault Related Field=RecId 2. Verify that the table that will hold the foreign key to the DimensionAttributeValueSet table is a data source on the form(the one on which you have to show dimensions). 3. Create a tab that will contain the financial dimensions control. This control is often the only data shown on the tab because the number of financial dimensions can be large. 4. set properties of Tab as under a) Set the Name metadata of the tab to TabFinancialDimensions. b) Set the AutoDeclaration metadata of the tab to Yes. c) Set the Caption metadata of the tab to @SYS101181 (Financial dimensions). d) Set the NeedPermission metadata of the tab to Manual. e) Set the HideIfEmpty metadata of the tab to No. 5. Override the pageActivated method on the new tab public void pageActivated() { dimDefaultingController.pageActivated(); super(); } 6. Override the following methods on the form. class declaration public class FormRun extends ObjectRun { DimensionDefaultingController dimDefaultingController; } init (for the form): public void init() { super(); dimDefaultingController=DimensionDefaultingController::constructInTabWithValues( true, true, true, 0, this, tabFinancialDimensions, “@SYS138487”); dimDefaultingController.parmAttributeValueSetDataSource(myTable_ds, fieldstr(myTable, DefaultingDimension)); } 7. Override the following methods on the form data source public int active() { int ret; ret = super(); dimDefaultingController.activated(); return ret; } public void write() { dimDefaultingController.writing(); super(); } public void delete() { super(); dimDefaultingController.deleted(); }
AX 2012 Developer Resources
AX 2012 Developer Resources This page collects the AX 2012 Development Articles available at blog, as well as the most relevant links to Microsoft documentation. They are arranged by topic. You will find duplicate links for articles that touch multiple topics.General TopicsMicrosoft Guide: What’s New for Developers (download) [fixed link – thanks to reader Waldemar Pross]Microsoft Guide: New, Changed and Deprecated Features (download)Microsoft Whitepaper: Deploying Customizations Across Environments (download)Dynamics AX 2012 System Requirements (download)Deploying AX 2012 CodeImporting Data Using the Excel Add-InsX++ LanguageX++ as a Managed Language in the .NET Runtime (code walkthrough)AX 2012 X++ Language Changes, Stricter Syntax (MSDN Article).NET Interop to X++ Issues when X++ runs as CIL (MSDN Blog)Deploying AX 2012 CodeNew Query Object Features (code walkthrough)Creating Code Snippets and method templates (code walkthrough)Data AccessComputed View Columns (code walkthrough)Valid Time State/Date Effective Framework – Part 1: Creating the table (code walkthrough)Valid Time State/Date Effective Framework – Part 2: Querying time state tables (code walkthrough)Microsoft Whitepaper: Using Date Effective Patterns (download)DebuggingDebugging X++ Running in CLR using Visual Studio (code walkthrough)EventsIntroductionEventing Basics (code walkthrough)Managed Handlers for Pre/Post events (code walkthrough)Managed Code Handlers for Delegates (limitations) (code walkthrough)Microsoft Whitepaper: Eventing (download)Eventing Terminology and Keywords (MSDN Article)Naming Conventions for Delegates and Event Handlers (MSDN Article)ReportingMultiple instances of Reporting Services on the same machine (TechNet Article)Microsoft Whitepaper: Report Programming Model for Dynamics AX 2012 (download)SysOperation FrameworkFrom RunBase to SysOperation: Business Operation Framework (code walkthrough)From RunBase to SysOperation: Business Operation Framework (SysOperation query and customizing BOF dialog) (code walkthrough)MSDN SysOperation Framework (MSDN Article)SysOperation Framework Whitepaper (download)Foreign-Key Table RelationshipsRecIds as Foreign Keys (code walkthrough)Microsoft Whitepaper: Migrating EDT Relations (download)UnitOfWorkUnit of Work Magic (code walkthrough)Table InheritanceMicrosoft Whitepaper: Developing with Table Inheritance (download)Model ArchitectureModels and Layers Basics (code walkthrough)Powerful Combination of Models and Events for No-Merge Code Solutions (code walkthrough)Deploying AX 2012 CodeManaged CodeUsing Visual Studio 2010 with AX 2012 (code walkthrough)Writing and Calling Managed Code from AX (code walkthrough)Limitations for Managed Code Event Handlers (code walkthrough)Proxy Classes Gotcha (code walkthrough)Creating Proxies for Kernel Classes (classes not visible in the AOT) (code walkthrough)Microsoft Whitepaper: Selecting the Best Development Technology for Your Scenario (download)X++ as a Managed Language in the .NET Runtime (code walkthrough).NET Assembly Deployment in AX 2012.NET Interop to X++ Issues when X++ runs as CIL (MSDN Blog)ServicesFrom RunBase to SysOperation: Business Operation Framework (code walkthrough)Using System Query Service in WPF (code walkthrough)MSDN Business Operation Framework (MSDN Article)Microsoft Whitepaper: Services (download)Consuming External Webservices (code walkthrough)Trusted Intermediary in AIF (code walkthrough)SecurityTrusted Intermediary in AIF (code walkthrough)Microsoft Whitepaper: Developing Extensible Data Security Policies (download)Microsoft Whitepaper: Using The Policy Framework (download)Various10-minute AX 2012 App: WPF (code walkthrough)10-minute AX 2012 App: Windows Azure (code walkthrough)10-minute AX 2012 App: Windows Phone 7 PART1 (code walkthrough)10-minute AX 2012 App: Windows Phone 7 PART2 (code walkthrough)10-minute AX 2012 App: Windows Phone 7 PART3 (code walkthrough)app.html For more info – http://daxmusings.blogspot.in/p/microsoft-dynamics-ax-2012-developer.html
“Error when executing direct SQL – SqlStatementExecutePermission”
While accessing SQL statements within AX world I came across an error which was really time consuming for me to get rid of. I created a method like this; It got failed while executing statement and gave following error ” Error when executing direct SQL – SqlStatementExecutePermission” on line resultSet = statement.executeQuery(sql); SOLUTION: You can solve this issue easily, if you use the method marked as server static and call this method from the display method.
Dynamics AX 2012: “Precision lost” warning message
This post is copied from Peter Villadsen blog and I thought to share it on my blog too. It really helped me a lot. A question came up at today’s webinar where a developer had a (presumably legitimate) reason to cast a real value into an integer value. The X++ language does not allow explicit casting (there’s no support for it in the language), but the compiler will do its best to satisfy the user and do the conversion on its own. In this case, however, it issues a warning message, lest this is not what the user wanted. One solution is to use the anytype type to hold the vaue for conversion and then using the any2int function, as shown below: static void Job47(Args _args) { real r = 3.13; int i = r; // Warning is issued here anytype a; a = r; // Assign to an anytype variable… i = any2int(a); // … and back into an int print r; print i; pause; } This should be packaged into a function, maybe called int RealToInt(real arg). Another way would be doing the conversion in managed code (through the System.Convert::ToInt32(object) method), but the performance will not be as good because of the marshalling that needs to take place. I hope this helps.
Code for Traverse between Tables and all the fields
With reference of Bineet’s blog here I found the code for Traverse between tables and all the fields. //Travese between tables and for each table traverse between all the fields static void TeeNode_traverse(Args _args) { TreeNode treeNode, treeNodeTable; TreeNodeIterator iterator; void traverseFields(TreeNode _treeNode) { TreeNode parentNode; parentNode = _treeNode.AOTfindChild(‘Fields’); //treeNodeTable = _treeNode.AOTfirstChild(); iterator = parentNode.AOTiterator(); parentNode = iterator.next(); while(parentNode) { //treeNodeTable = treeNodeTable.AOTfirstChild(); parentNode = iterator.next(); } } ; treeNode = TreeNode::rootNode(); treeNode = treeNode.AOTfirstChild(); treeNodeTable = treeNode.AOTfindChild(‘Tables’); treeNodeTable = treeNodeTable.AOTfirstChild(); while(treeNodeTable) { traverseFields(treeNodeTable); treeNodeTable = treeNodeTable.AOTnextSibling(); } }
How to get table name and number of records in each table in AOT
Today, I came across a requirement to find out the name of each table in AOT along with the number of records for each table. Here is the code to achieve this functionality; void getTableNameRecordCount(Args _args) { #AOT Name name; NumberOf recordCount; TreeNode treeNode; SysDictTable sysDictTable; ; treeNode = TreeNode::findNode(#TablesPath); treeNode = treeNode.AOTfirstChild(); while (treeNode) { name = treeNode.AOTname(); sysDictTable = SysDictTable::newTableId(treeNode.applObjectId()); recordCount = sysDictTable.recordCount(false); if (recordCount) info (strfmt(“@SYS26868”, name, recordCount)); treeNode = treeNode.AOTnextSibling(); } }
Inside MS Dynamics AX 4.0 and MORPHIX IT
Inside MS Dynamics AX 4.0: http://www.4shared.com/file/hI4Hbnn7/MicrosoftPressInsideMicrosoftD.html? MORPHIX IT: http://www.4shared.com/file/hI4Hbnn7/MicrosoftPressInsideMicrosoftD.html?
CRUD operation in Dynamics AX 2009 through .Net business connector
Friends, rather going into more details about “How to’s” of accessing Dynamics AX through .Net, my main objective is to share my experience of performing CRUD operations in Dynamics AX 2009 through .Net BC. Here is a sample code; // CREATE OR INSERT SAMPLE // Create the .NET Business Connector objects. Axapta ax; AxaptaRecord axRecord; string tableName = “AddressState”; try { // Login to Microsoft Dynamics AX. ax = new Axapta(); ax.Logon(null, null, null, null); // Create a new AddressState table record. using (axRecord = ax.CreateAxaptaRecord(tableName)); { // Provide values for each of the AddressState record fields. axRecord.set_Field(“NAME”, “MyState”); axRecord.set_Field(“STATEID”, “MyState”); axRecord.set_Field(“COUNTRYREGIONID”, “US”); axRecord.set_Field(“INTRASTATCODE”, “”); // Commit the record to the database. axRecord.Insert(); } } catch (Exception e) { Console.WriteLine(“Error encountered: {0}”, e.Message); // Take other error action as needed. } // READ SAMPLE // Create the .NET Business Connector objects. Axapta ax; AxaptaRecord axRecord; string tableName = “AddressState”; // The AddressState field names for calls to // the AxRecord.get_field method. string strNameField = “NAME”; string strStateIdField = “STATEID”; // The output variables for calls to the // AxRecord.get_Field method. object fieldName, fieldStateId; try { // Login to Microsoft Dynamics AX. ax = new Axapta(); ax.Logon(null, null, null, null); // Create a query using the AxaptaRecord class // for the StateAddress table. using (axRecord = ax.CreateAxaptaRecord(tableName)); { // Execute the query on the table. axRecord.ExecuteStmt(“select * from %1″); // Create output with a title and column headings // for the returned records. Console.WriteLine(“List of selected records from {0}”, tableName); Console.WriteLine(“{0}t{1}”, strNameField, strStateIdField); // Loop through the set of retrieved records. while (axRecord.Found) { // Retrieve the record data for the specified fields. fieldName = axRecord.get_Field(strNameField); fieldStateId = axRecord.get_Field(strStateIdField); // Display the retrieved data. Console.WriteLine(fieldName + “t” + fieldStateId); // Advance to the next row. axRecord.Next(); } } } catch (Exception e) { Console.WriteLine(“Error encountered: {0}”, e.Message); // Take other error action as needed. } // UPDATE SAMPLE // Create an Axapta record for the StateAddress table. axRecord = ax.CreateAxaptaRecord(tableName); // Execute a query to retrieve an editable record where the name is MyState. axRecord.ExecuteStmt(“select forupdate * from %1 where %1.Name == ‘MyState’”); // If the record is found then update the name. if (axRecord.Found) { // Start a transaction that can be committed. ax.TTSBegin(); axRecord.set_Field(“Name”, “MyStateUpdated”); axRecord.Update(); // Commit the transaction. ax.TTSCommit(); } // DELETE SAMPLE // Execute a query to retrieve an editable record // where the name is MyStateUpdated. axRecord.ExecuteStmt(“select forupdate * from %1 where %1.Name == ‘MyStateUpdated’”); // If the record is found then delete the record. if (axRecord.Found) { // Start a transaction that can be committed. ax.TTSBegin(); axRecord.Delete(); // Commit the transaction. ax.TTSCommit(); }
How to reuse table Id in Dynamics AX
Sometime we created tables just for testing purpose within AOT and later on we delete these tables. In such cases we don’t care about the IDs which are created for each table. There is a way to use these system generated IDs for other newly created tables. You can do this by following steps; 1. Export the table with its current id. 2. Delete the table 3. Edit the xpo file and change the id to what you want 4. Import the xpo file with the id option checked. As long as the id is not used by something else, then it should get imported with that id.