Posts

Showing posts from 2011

AOS and Clusturing

There seems to be quite some vagueness when it comes to Ax and AOS clustering. A few statements to (hopefully) clear things up a bit: Single AOS The simplest configuration is an Ax implementation with one single AOS server. Extra AOS servers can be added in scenarios where you want to increase availability or scale up the Ax environment to handle a larger number of users/connections. Several possibilities from that point on: AOS side by side By default multiple AOS's in a single Ax environment will exist side by side. They do know about each others existence, sync their caches, try not to hamper each other too much,  … A user connects to a specific AOS as defined in his client configuration. In case there is more than one AOS defined in the configuration the first available will be used. Adding all available AOS's to one client config file would probably be a smart thing to do. If you only add one node of the cluster to your config file, and this one node is down, y...

Automatic look ups in Axapta

INTRODUCTION The standard lookup system in Axapta is based on the use of table field or data type relations. These specify a link between a particular data type, or particular table field, and a corrsponding field in another table containing the base (reference) data. Generally, relations are made on the datatype (EDT) in the AOT, and will then automatically apply to any table field using that EDT. For example, in the standard application, the CustAccount EDT has a relation specified to CustTable.CustAccount. This means that any table field using the CustAccount EDT will be automatically given a lookup icon which allows the user to select from the list of accounts in CustTable. It is possible to further restrict the values which will appear in the lookup by specifying a "Related fixed field" relations on the datatype. In this case, only those values satisfying the relation will be shown in the lookup. See the Dimension datatype for an example of this (each Array Element ...

Info on Indexes

Very helpful information on indexes http://sumitsaxfactor.wordpress.com/2011/05/05/info-on-indexes/

Failed to register SharePoint WSS3.0 Services

Installing sharepoint http://www.programminghelp.com/software/installing-sharepoint-services-on-small-business-server-2003/ Error Prompted while running SharePoint Products and Technologies Configuration Wizard   Failed and displayed error “Failed to register SharePoint Services. An exception of the System.Runtime.InteropServices.COMException was thrown. Additional exception information: Could not access the Search service configuration database Did this following steps and the configuration finished successfully. 1.       On the Start menu, click Run. In the Open box, type regedit and then click OK.   2.       In the Registry Editor, navigate to the following subkey, and then delete it:          HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\Services\Microsoft.SharePoint.Search.Administration.SPSearchService Run the SharePoint Products and Technologies Co...

Primary key, Primary Index and Clustured Index,,,,

There are two main types of indexes that we can have on a Microsoft SQL Server backend Database. These are normal and clustered indexes. Normal index can be viewed as the index in the back of a book. We first look in the index for a topic. After finding the topic in alphabetical order we also find the page number or address of the topic in the book. We then use the address to easily find the topic. If we did not have this index we would have to search sequentially through the book and the larger the book the greater the effort and time to either find a topic or realize that it does not exist. This is similar to a normal index in the database where we have the data stored in one file and the index stored in another file in the order specified. The database engine using the index will first look in the index file then retrieve the address of the record that is used to locate the record in the data file. For clustered index the records in the data file are sorted in the order of the...

Events on FORMS:

Opening a form: sequence of events When you open a form the following sequence of events occurs: 1. The new constructor on the form is activated. 2. The init method on the form is activated. 3. The init method on the form data source is activated. 4. The run method on the form is activated. 5. The executeQuery method on the form data source is activated. 6. The firstField method on the form is activated. Closing a form: sequence of events When you close a form by clicking a Cancel button, the following sequence of events occurs: 1. The closeCancel method on the form is activated. 2. The canClose method on the form is activated. 3. The close method on the form is activated. When a form is closed with CloseCancel, user modifications are not saved. When you close a form by clicking the close button ( ) or an OK button, the following sequence of events occurs: 1. If the form is closed with an OK button, the closeOK method on the form is executed. closeOK is not activ...

close methods on a form

There are “only” 5 ways to close a form: 1. Close - close the form 2. CloseOK – close the form, and set the OK flag – called by the commandbutton: Ok 3. CloseCancel – close the form, and set the Cancel flag – called by the commandbutton: Cancel 4. CloseSelectRecord – close the lookup form, and set return record 5. CloseSelect – close the lookup form, and set return value The methods in past-tense are used to determine if or how a form was closed: 6. Closed – The form is no longer open 7. ClosedOK – The form was closed by the user clicking ‘OK’ 8. ClosedCancel – The form was closed by the user clicking ‘Cancel’ And canClose() is called before any of the close methods get called.

RunOn property in Axapta

The class has a RunOn property that have three values: Client, Called From and Server. Objects created from the class will then live at the location specified. If you choose Called from, the object will live at the tier where the code creating it (by calling the new constructor) is running. Classes extending other classes will also inherit the RunOn property. You cannot change it if it is Client or Server. If it is Called from, you can leave it or change it to Client or Server. But someone may wonder that menu items have their RunOn properties, what will happen if the RunOn property of a given menu item pointing to a class is set to Server, whereas the class's RunOn property is set to Client. The answer is that only if the Class's RunOn property is set to Called From, the objects will be created determined by menu item's RunOn property. Also there is another situation, the class has static main method which has a RunOn property as well. What will happen if the menu ite...

Install Dynamics AX 2009 Reporting Extensions with SQL server 2008..

Sometime back, I have experience on interesting issue while installing Reporting Extensions with SQL server 2008, When I run the Setup, I get the following message : "You must install SQL server 2005 Reporting Services Service Pack 2 before installing the report extensions". Here is the workaround 1. Locate the Dynamics AX 2009 Reporting services dll from the extracted AX 2009 SP1 folder[\\AX2009SP1\support\axsetupresources\microsoft.dynamics.setup.reportingservices.dll;File Version - 5.0.1000.52] Extract the AX 2009 .iso to a folder Copy the microsoft.dynamics.setup.reportingservices.dll into the folder:  \\DynamicsAX\Msi\Components32\Program Files\Microsoft Dynamics AX\50 and Setup \\DynamicsAX\Msi\Components64\Program  Files\Microsoft Dynamics AX\50\Setup It will ask to replace the existing dll having File Version - 5.0.593.0. Say Yes and replace. 5. Then Install AX Reporting Services extensions. It works fine and the Reporting Extensions are installed nice.

Error executing code: Wrong argument types for comparison.

ERROR: Error executing code: Wrong argument types for comparison. Stack trace: (C) \Classes\QueryRun\next (C) \Classes\FormDataSource\executeQuery (C) \Forms\MyForm\Data Sources\MyFormDatasource\Methods\executeQuery - line 4 (C) \Classes\FormDataSource\linkActive (C) \Forms\MyForm\Data Sources\MyFormDatasource\Methods\linkActive - line 3 SOLUTION: on the form init, public void init() { super(); this.query().dataSourceNo(1).clearDynalinks(); }

AX Client Cannot Connect to AOS

This may be a simple one for some of you, but these are the common things to look out for when installing clients so that they will connect to the AOS: 1.         Ensure the port you are trying to connect to is open on the Internal Firewall. Default is 2712. This can be changed in the AOS however, so ensure whatever port that is, that it is open for the client to access 2.         When creating a config file from the server that is a 64bit computer, it points the folders to “Program Files (x86)”. If you are importing that AXC into the client, ensure that you change the folder pointers to “Program Files” first, before importing it. 3.         Ensure that you have matching Service Packs installed on both client, AOS and Application

Basics of setting up AX2009 security keys

Basics of setting up AX2009 security keys Set up alerts a. Go to Basic > Number Sequence > Reference > System ID i. Ensure that the Basic_01 number sequence exists. If not, create. b. Set up Basic > Setup > Email Templates c. Basic > Setup > Alerts > Set up email ID d. Administration > Batch Groups i. Create "Alerts" Batch Group e. Administration > Setup > Server Configuration i. Tick Is Batch Server ii. On Batch server groups tab, select "Alerts" f. Basic > Setup > Alerts > Manage alert rules g. Basic > Setup > Alerts > Periodic > Alerts > Change based alerts i. Add to "Alerts" batch group and send to batch h. Basic > Setup > Alerts > Periodic > Alerts > Due date alerts i. Add to "Alerts" batch group and send to batch i. Administration > Common forms > Users > User options i. Set up email ii. On Notifications tab, set up parameters iii. On Status ...

create a copy of a Dynamics AX 2009 live company on a test server.

In order to create a copy of Live company on a test server for Dynamics AX 2009, there are two scenarios. Scenario 1: Copy the entire environment This is a relatively easy scenario as explained in below steps 1. Copy over the Dynamics AX SQL Database and restore on the other SQL server 2. Copy over the application folder of Dynamics AX and paste it in Application folder content. (Default location is C:\Program Files\Microsoft Dynamics AX\50\Application\Appl). 3. Now point AOS to the newly copied application folder. Scenario 2: Only data to be copied to the test environment 1. Follow the step as 1 above and in this scenario there is no need to copy the Application folder. 2. Run Synchronize so that the database structure matches the application files on the test server.

Tutorial: refresh, reread, research, executeQuery - which one to use?

content copied from -  http://kashperuk.blogspot.com/2010/03/tutorial-reread-refresh-research.html X++ developers seem to be having a lot of trouble with these 4 datasource methods, no matter how senior they are in AX. So I decided to make a small hands-on tutorial, demonstrating the common usage scenario for each of the methods. I have ordered the methods based on the impact on the rows being displayed in the grid. You can download the  xpo with the tutorial on my SkyDrive . 1. Common mistakes Often, developers call 2 of the mentioned methods in the following order: formDataSource.refresh() formDataSource.research() or formDataSource.reread() formDataSource.research() or formDataSource.research() formDataSource.executeQuery() or formDataSource.research() formDataSource.refresh() / formDataSource.reread() All of these are wrong, or at least partially redundant. Hopefully, after reading the full post, there will be no questions as to why they are wrong. Leave ...

Refresh,Reread, Research functions in Axapta...

.refresh() will not reread the record from the database.  It basically just refreshes the screen with whatever is stored in the form cache. .reread() will only re-read the CURRENT record from the DB so you should not use it to refresh the form data if you have added/removed records.  It's often used if you change some values in the current record in some code, and commit them to the database using .update() on the table, instead of through the form datasource.  In this case .reread() will make those changes appear on the form. .research() will rerun the existing form query against the datasource, therefore updating the list with new/removed records as well as updating existing ones.  This will honour any existing filters and sorting on the form. .executeQuery() is another useful one.  It should be used if you have modified the query in your code and need to refresh the form.  It's like .research() except it takes query changes into account....

Maps In Axapta

There are two kinds of maps in AX. There is a collection class called map,which basically just maps a set of keys to a set of values. And then there is the table map, which is kind of a interface for individual tables. For example all table holding address information are parts of  the AddressMap table map.

Install Dynamics AX 2009 Reporting Extensions with SQL server 2008

Install Dynamics AX 2009 Reporting Extensions with SQL server 2008 Sometime back, I have experience on interesting issue while installing Reporting Extensions with SQL server 2008, When I run the Setup, I get the following message : "You must install SQL server 2005 Reporting Services Service Pack 2 before installing the report extensions". Here is the workaround 1. Locate the Dynamics AX 2009 Reporting services dll from the extracted AX 2009 SP1 folder[\\AX2009SP1\support\axsetupresources\microsoft.dynamics.setup.reportingservices.dll;File Version - 5.0.1000.52] Extract the AX 2009 .iso to a folder Copy the microsoft.dynamics.setup.reportingservices.dll into the folder: \\DynamicsAX\Msi\Components32\Program Files\Microsoft Dynamics AX\50 and Setup\\DynamicsAX\Msi\Components64\Program Files\Microsoft Dynamics AX\50\Setup It will ask to replace the existing dll having File Version - 5.0.593.0. Say Yes and replace. 5. Then Install AX Reporting Services extensions. ...

Events during opening and closing of form.

Events on FORMS: Opening a form: sequence of events When you open a form the following sequence of events occurs: 1. The new constructor on the form is activated. 2. The init method on the form is activated. 3. The init method on the form data source is activated. 4. The run method on the form is activated. 5. The executeQuery method on the form data source is activated. 6. The firstField method on the form is activated. Closing a form: sequence of events When you close a form by clicking a Cancel button, the following sequence of events occurs: 1. The closeCancel method on the form is activated. 2. The canClose method on the form is activated. 3. The close method on the form is activated. When a form is closed with CloseCancel, user modifications are not saved. When you close a form by clicking the close button ( ) or an OK button, the following sequence of events occurs: 1. If the form is closed with an OK button, the closeOK method on the form is executed. cl...

properties of tables in axapta

The most important properties of tables in axapta TitleField1 and TitleField2: Specify fields that are displayed in the active title bar of forms • ConfigurationKey and SecurityKey: Specify that only users authorized to access the data can do so. We strongly recommend setting these options. • CacheLookup: Specifies how the table is to be cached to optimize data access. • CreateRecIdIndex: Allows you to create a RECID index. Axapta automatically adds a RECID to every table when its created, so that you can use it as an index; however, if you have a well-designed data model, then that should not be necessary. • PrimaryIndex and ClusterIndex: Specifies which field is your primary and clusteredindex, which requires that you have created the respective fields beforehand. Defining tables consists of creating the table itself and the following subtypes: • Fields: Dictates where your data is actually placed, and when you create these you specify the base data type each holds. However, you shou...

AXBC Classes in Axapta

AXBC Classes in Axapta  (Axapta Business Component Classes) Ax /AxBC classes The Ax class is an X++ class that wraps a table to track state. An example of an Ax class is AxLedgerJournalTable. All Ax classes derive from the AxInternalBase class. From a service perspective, it is important to understand which elements that the consumer has passed to the service, so proper defaulting can occur. Ax classes share three common characteristics. They contain generated 'parm' methods that wrap all the fields on the table. When an incoming message is deserialized, the service infrastructure invokes each 'parm' method for which the consumer passed data. These 'parm' methods then set state and update the database table. Therefore, after deserialization, the class maintains the elements that the consumer passed to the service. This allows field defaulting to use the values the consumer passed. In general, the generated 'parm' methods are sufficient...

Microsoft Dynamics Ax 2012 is coming...

This is going to be a major step forward in erp systems. 1200+ what’s new features Here are some to whet your appetite: • redesigned forms – a brand new look. • a form developed for the rich client can be used in EP just by publishing it. • migrates all reports to SSRS reports • forms can be reused. • aot can be accessed from Visual Studio. • new security structure is role based • trace can be invoked from the client • the new Tfs integration also supports work item • as and is key words are supported by x++ • more smoother integration between x++ and c#. objects can be just passed between both the languages. • different environments for development and application. • tables can be inherited • a lot of properties has been added to reduce setup through code. • rich use of powershell • a new command line utility called axutill is introduced Note: • the new version supports only vs 2010 • Oracle db is no longer supported • the rich client doesn’t supports windows xp • though th...

The mystery of "index" vs. "index hint"

In the Axapta community, there is still a big confusion about the "index" and "index hint" statements used in connection with selects. So, what is the Axapta kernel *really* doing: Using "index": when you add the statement "index MyIndex", the Axapta kernel will add an "ORDER BY" with all the fields of the index. Example: select * from InventTable index GroupItemIdx will generate the following SQL statement to the database: SELECT A.ITEMGROUPID, A.ITEMID, A.ITEMNAME,.... FROM INVENTTABLE A ORDER BY A.ITEMGROUPID, A.ITEMID The Index ItemGroupIdx of the InventTable exactly contains the two fields ItemGroupID and ItemId (in that order). Using "index", you still give the control of which index to use to the database optimizer. So, if the optimizer finds a better index to use, it will use it. Using "index hint": when you add the statement "index hint MyIndex", the Axapta kernel will add a statement to instruct t...

Cache in Dynamics Ax 2009

Many a time we have issue regarding data, on debugging found that old record is overriding new record… Sometimes it could be because the cache is not getting refreshed. Cache are used both on client and server. Microsoft Dynamics AX runtime manages the cache by replacing old record with new record are added to the cache. If one want to delete(or) clean up the local cache file, below are the following step: · Stop the AOS · Delete the ‘.auc’ file from location ‘ user\AppData\Local\ *.auc’ · Restart AOS. Scenario -  Suppose there are 2 AOS that required to flush the cache but then we cannot stop or start the AOS. How can one refresh the Cache? There are three menu action items that can be used to flush system data, the AOD, and dictionary. The thing about these though is that they are set to run at "called from" which when ran clear the client cache. The trick is to copy these three menu items, and then change the run from property ...

New features In AX 2012

AX6 sneak preview - SQL AOD (AxSYS.axmodel) A model is like a developer's layer in which he can keep his modified/new objects and import/export/delete in different AX environments just like we do in layers Dynamics Ax’s model database is stored in a Microsoft SQL Server database. The speed is back. Navigating the AOT is suddenly a pleasure again. Meta data heavy operations, like searching, completes an order of magnitude faster. For example; searching all methods on forms for any text completes in 2 seconds Dynamics AX supports a new file format: ax model-files. (extension: "ax model", example: "AxSYS.axmodel"). These are binary files, and provides the same deployment capabilities as AOD files did - and yet they are less than half size. Using a new tool you can import/export ax model files to/from SQL. You can also import AOD files into SQL. The compiled source is also stored in the database (as a blob) The labels are now also stored in SQL. We still support exp...