Posts

Showing posts from 2014

Issues with Deleting Dynamics AX In Bound port

Image
First thing to note is to delete a Dynamics AX In-Bound port, you must ensure that the port is Deactive. In case you try to delete an Active port, you will get an error message similar to below. The port 'InBound port name' must be undeployed before it can be deleted. Just click button Deactivate after selecting the port you want to delete. Path: System administration > Setup > Services and Application Integration Framework > Inbound ports Another issue which you might have encountered while trying to delete an InBound port is the error message – “Port cannot be deleted while dependent Gateway queue exist. Delete dependent Gateway queue and try again.” This happens when you have dependent records in Queue manager. The solution is to go to Queue manager and delete all the records which are using the port you want to delete. Path: System administration > Periodic > Services and Application Integration Framework > Queue manager

Code: X++ script to disable AX users

If you are looking for script to quickly disable AX users. This way you can keep people out of the AOS without actually needing to remove the user.    Three approaches for the code: 1. Simple Job to disable the specified user in UserInfo table. static void disableUsers(Args _args) {     UserInfo userInfo;     ;       //a00008 is the user id which we want to disable.     while select forUpdate userInfo where userInfo.id == 'a00008'     {         if(userInfo)         {             ttsBegin;                          userInfo.enable = 0;             userInfo.update();                          ttsCommit;       ...

Difference between InMemory and TempDB tables in AX 2012

Image
Basically in AX2012 there are two types of Temporary tables, (i)TempDB tables and (ii)InMemory Tables. Basic differences between them are: InMemory tables TempDB tables 1. Holds data temporarily in client or server tier 1. Holds data temporarily in database till the scope is valid 2. These tables can't be stored in Database 2. These tables are stored in the database 3. Can't apply security 3. Can apply security 4. We cannot use InMemory table buffers 4. TempDB table buffer can be used in coding TempDB tables We call them TempDB tables because their TableType property value is TempDB. This value comes from the TableType::TempDB enum value. The TableType property value can be set at AOT > Data Dictionary > Tables > MyTempDBTable > Properties > TableType. All types of temporary tables are automatically dropped by the system when the table variable in X++ goes out of scope. A TempDB...

What and how: Configuring Account structures.

Image
What are Account structures? Account structures can be defined as a correct combination of valid accounts and financial dimension values, based on the requirement. This also includes setting up rules to specify how the accounts and dimension are related. Just to give you the background, whenever we post a transaction in Dynamics AX, the accounting is done in the Main Account, however the accounting can also be done in several financial dimensions. And the Account structure allows us to define valid combinations of main account and financial dimensions.   Configure account structures form (in Ax2012): The "Configure account structures" form is used to create the Account structures. As mentioned above, Account structures consists of 'Main Accounts' and can include 'financial dimension' segments. So in this form, we need to define the valid combinations, which together with the main accounts, form (become) a Chart of Accounts (COA)   In the "Configur...

AX Menu items and how to create menu item

Image
Menus Items You can use menu items to activate application objects from the user interface. Three types of menu items can be created: • Display - used for forms • Output - used for reports • Action - used for running processes Display Menu Items Are used to open objects that appear on the screen, typically forms. For example, clicking the Customers menu item in the Accounts Receivable module opens the CustTableListPage form. This Display Menu item points to the Form object CustTableListPage. There are two important Properties to notice. • Object type = Form • Object = CustTableListPage   How to: Create a Menu Item Task: To create a menu item to open the AJ_BookTypeForm To understand the example scenario - Go here 1. Open the AOT, expand the Menu Items node. 2. Open a second AOT and locate the AJ_BookTypeForm 3. Drag the AJ_BookTypeForm form to the Display node of the Menu Items node. A new display menu item is created. 4. In the properties shee...

How to: Create a Form

Image
To create a form that will be used to view, create and edit records in the AJ_BookTypeTable. 1. In the AOT, right-click the Forms node and select New Form. 2. Rename the form to AJ_BookTypeForm. 3. In a second AOT, locate the table AJ_BookTypeTable. 4. Drag the table AJ_BookTypeTable to the DataSources node on the AJ_BookTypeForm 5. Expand the Designs node on the AJ_BookTypeForm. 6. Right-click the Designs node and select New Control > Grid. A new Grid control is created. 7. Expand the DataSources > AJ_BookTypeForm > Fields node. 8. Drag the fields AJ_BookTypeID and Name to the grid control. 9. On the properties sheet for the Design node, in the Caption property, enter "Type of books". 10. Save your changes to the form. To understand the example scenario - Go here  

How to: Create a Relation

Image
Use this step procedure to create a relation between the AJ_SubGenreTable and the AJ_BookTypeTable. The Sub-genre is related to the BookType table. For example, the Sub-Genre 'Poems' can be only related to the record "Poetry" in the AJ_BookTypeTable table. You should not be able to have a "Novels" as Sub-genre for "Poetry". To understand the example scenario - Gohere To understand more details about types of relations: Gohere . 1. In the AOT, locate the AJ_EDTBookTypeID EDT. 2. Right-click the AJ_EDTBookTypeID EDT and select Properties. 3. In the ReferenceTable property enter AJ_BookTypeTable. 4. Close the properties sheet. 5. Expand the AJ_EDTBookTypeID node. 6. Right-click the Table References node and select New > Table Reference. A new table reference is created. 7. Right-click the AJ_BookTypeTable Table Reference and select properties. 8. In the related field property, enter AJ_BookTypeID 9. Close the property sheet...

What are AX Table relations?

Relations between tables are used to: * Associate rows in one table to rows in another table. • Enforce business rules across tables • Create auto joins in forms (join one table to another table). • Look up values in other tables (using lookups and the View Details command). • Validate data by providing constraints • Automatically propagate changes from one table to another by defining cascading relations. • Generating field help (hover over a field, and data from the related table is displayed). Relationships can be created between tables using MorphX • These relations are defined within the Microsoft Dynamics AX application and not at the physical database level. • Relations govern the relationships between data in different tables such as foreign key relationships. • Foreign key relationships between tables are always formed from the parent table. Under the relations node you can create different types of relationships between the parent table and ot...

How to: Create an Index and set it as primary

Image
How to: Create an Index Use the following procedure to create a new index on the AJ_BookTypeID field on the AJ_BookTypeTable NOTE: A field of data type memo or container cannot be used in an index. To understand the example scenario - Go here 1. Locate the AJ_BookTypeTable table in the AOT. 2. Right-click the Indexes node in the table and select New Index. A new index Index1 is created. 3. Rename the index to AJ_BookTypeIDIdx 4. Drag the field AJ_BookTypeID to the index AJ_BookTypeIDIdx node. 5. In the properties sheet for the AJ_BookTypeIDIdx node, set the property AllowDuplicates to No. How to: Set a Primary Index Use the following procedure to set the index created in the previous procedure to be a primary index. 1. In the AOT, locate the AJ_BookTypeTable table. 2. In the property sheet for the table, set the PrimaryIndex property on the table to AJ_BookTypeIDIdx 3. Close the property sheet for the table.  

How to: Create a New Table

Image
Use the following step procedure to create a new table that will store the records for the BookType. There are two fields on the table called BookTypeID (type AJ_EDTBookTypeID), and Name (type Name). To understand the example scenario - Go here 1. Open a new development workspace. 2. In the AOT, expand the Data Dictionary node. 3. Right-click the Tables node and select New Table. A new Table called Table1 is created. 4. Right-click Table1 and select Properties. 5. Modify the property Name to AJ_BookTypeTable 6. Modify the property Label to "Types of Books" 7. Close the property sheet. 8. Press Ctrl-D to open another AOT. Ensure window is not maximized by clicking the restore down button to enable you to view both AOT windows. 9. Expand the Data Dictionary node. 10. Expand the Extended Data Types node. 11. Locate the AJ_EDTBookTypeID EDT. 12. Drag the AJ_EDTBookTypeID EDT to the Fields node of the AJ_BookTypeTable table. A new field called AJ_E...

How to: Create a New Extended Data Type

Image
Use the following procedure to create a new EDT that will define how the Id of the BookType is stored. To understand the example scenario - Go here 1. Open a new development workspace. 2. In the AOT, expand the Data Dictionary node. 3. Right-click the Extended Data Types node. 4. Select New > String. A new EDT called Type1 is created. 5. Right-click Type1 and select Properties. 6. Modify the property Name to AJ_EDTBookTypeID. 7. Modify the property Extends to SysGroup. 8. Modify the property Label to “Type of Book”. 9. Close the property sheet and click Save in the AOT to save your changes. 10. On the Database Synchronization dialog, click Yes. This will take a few minutes to complete.