Posts

Showing posts from September, 2011

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...