Tuesday, September 13, 2011

Typing focus jumps to mouse cursor location when typing

When working with a client who has a laptop, one thing that I see a lot of is that the mouse jumps around to the mouse cursor when typing rather than styaing on the location where the cursor focus should be (on the line being typed). This can almost seem random and frequent. This causes a lot of frustration and retyping work since you'll have words like HeWorldllo instead of Hello World. 

I can not guarantee it will fix everyone's issues but it did for me.

The following simple configuration change is how I fixed it on my system:
  1. Go to Start -> Control Panel -> Hardware -> click Mouse. 
  2. Click the 'Pointer Options' tab.
  3. Uncheck the Hide pointer while typing box (if unchecked already, something else is going on)
That should be it!
Figure 1 - The 'Mouse' configuration option in the control panel

Figure 2 - The 'Hide pointer while typing' option that should be unchecked.
\

Monday, August 22, 2011

How to change/rename an existing Item Number

Depending on the business that you run, you will create a bunch of items (or some other main value) that you will need to rename.  In this example, I am talking about renaming a unique record key value for the item master (InventTablee.ItemId), but you could apply this to any ‘unique record key’ field table in AX.  For those that are not fully technically inclined, a ‘unique record key’ for a table would be a field that unique identifies that record in a table.  Using the example of the item master in this blog post, the key field would be the item id as you could not have two records with the item id ‘001234’ for example; it is a unique identifier to that specific record...

Anyways, all nerding out aside, we’ll proceed talking about the scenario where we need to change the value for an item id and have this change be reflected across the entire system.  While it may seem that ItemId’s can be changed in the item master at any time without repercussions, this is not the case.  The trick is that the item number also needs to be changed in all other records that reference this ItemId (Item Number) since it uniquely identifies this record.

Steps to changing the item number to have it reflect the changes in the rest of the existing transactions:

1.       Right click on the unique field (Item Number/InventTable.ItemId) and select the ‘Record Info’ option (Figure 1 below)


Figure 1 - Right Click on the Item Number field and select 'Record Info'

2.       Select the ‘Rename’ button (n Figure 2 below).

a.       VERY IMPORTANT NOTE: This could take A VERY LONG time to complete depending on how many transactions exist for that record.  I’ve had it last anywhere from 1 minute to 3 hours.  The 3 hours was for a client that had incredibly large volume.
Figure 2 - The 'Rename' button on this form will allow you to change the item number displayed in the item number field


It’s a fairly simple process to complete but very powerful and can take a long time.  The only reason I am writing this entry is that I was sharing beers with a seasoned AX consultant who did not know how to do this.  He did not work for our company but definitely pointed out to me how this feature is not really talked about in any specific point.  While it may seem obvious to the technical folk (or not), it may not be obvious to the functional peeps.

Just make sure to be VERY careful with this process.  I think its solid but I cannot vouch for it being 100% perfect.  I’ve never seen it faulter but PLEASE take the following precautions before doing this:

1.       Backup the PROD database

2.       Restore PROD to TEST/UAT/DEV (or whatever…)

3.       Execute the procedure on your target record

4.       Do extensive testing on that record Before and After this process (either BI reports or manual comparison)

5.       Compare the results and make sure all the target results are like you would expect

6.       Make the change in the PROD environment

7.       Validate the data in the PROD environment

8.       Sign off the change and party like its 1999 (pre-Y2K catastophies! [psych])

Friday, July 29, 2011

Management Reporter reports stuck in the queue.


Well, your Management Reporter reports are stuck and you can't run anything.  That is no fun.  What the hell is going on?

Don't worry (yet).  This is a common issue that we see with Management Reporter.  It will happen in any product that runs MR whether it is AX, GP, NAV, or similar. It can be due to many issues.  The key to this is determining what is causing it if it occurs on a very common basis.

Thankfully, there is an easy way to fix this: restart the MR services.  The tricky part is finding out why its happening since its not a reasonable expectation to have to deal with this when it goes down all the time.

Below is a good guide from Microsoft in debugging this issue.  I would STRONGLY suggest any IT staff dealing with MR read this guide since this issue will inevitably happen.

There are five potential causes for this error:
There are five potential causes for this error: 

Cause 1
If the Management Reporter Process Service is on the same machine as the machine hosting your ManagementReporter SQL database. The Process Service may have errored out by attempting to start before SQL Server was accepting connections. See Resolution 1 in the Resolution section. 

Cause 2
A SQL Server connection error has occurred and the Management Reporter Process Service needs to be restarted. See Resolution 2 in the Resolution section. 

Cause 3
The user running the Management Reporter Process Service does not have sufficient permissions to read from the ManagementReporter SQL Server database. See Resolution 3 in the Resolution section. 

Cause 4
The SQL Service Broker on the ManagementReporter SQL Server database is not enabled. See Resolution 4 in the Resolution section. 

Cause 5
This can happen if the owner of the Management Reporter database is a Windows User while the SQL Server Service is being run by a local user. If you check the Event Viewer, you may see this message:

An exception occurred while enqueueing a message in the target queue. Error 15404, State 19. Could not obtain information about Windows NT group/user 'domain\user', error code 0x5.

See Resolution 5 in the Resolution section.
Resolutions

Resolution 1
If using Windows Server 2008 you can set the Management Reporter Process Service to Automatic (Delayed Start) rather than Automatic.
OR
Restart Process Service manually or with a script similar to the following:

NET STOP MRProcessService
NET START MRProcessService

Resolution 2
Restart Process Service manually or with a script similar to the following:

NET STOP MRProcessService
NET START MRProcessService

Resolution 3
Grant the user running this service the GeneralUser role under the Management Reporter database in SQL Server. This user can be found on the Log On tab under the Services Control panel.

Resolution 4
Run the following statement on the SQL server where your ManagementReporter database resides:

SELECT name, is_broker_enabled FROM sys.databases WHERE name = DB_NAME() AND is_broker_enabled = 1

This statement should return a row for the ManagementReporter SQL Server database. If it does not, run the statement below to re-enable the SQL Service Broker on the ManagementReporter SQL Server database:

ALTER DATABASE [ManagementReporter] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;

Resolution5
Change the database owner to sa or change the SQL Server Service user to a domain user.

Wednesday, July 27, 2011

How to find the SQL Server version from within AX 2009

I am usually asked how to find various information around SQL Server from within AX. This can happen from either a fellow consultant or a client.

Usually from a consultant standpoint, it is in the scenario where they are thrown into a situation where they don’t really know anything about the client and it is one more thing for them to ask people. Another scenario would be when a consultant or client need to submit a ticket to a company for support and the company needs to know some information around SQL Server.

Whatever the case may be, people will need to be able to get information about SQL from AX and those people may not be technologically inclined. AX has a way to do this :-)

To find out information about SQL, navigate to Administration -> Inquiries -> Database -> ‘Database information’ (Figure 1).

Figure 1 - Database Information form location
In figure 2 below it, shows the Database Information form that will pop up to the user. There are three tabs on this form: ‘General’, ‘System variables’, and ‘ODBC’. There is a whole lot of information on these tabs but I doubt a lot of it would apply to most people. The primary information people will want to see:
  • First tab (Figure 2)
    • Logon database
      • The database the current AX environment is using
    • Logon server
      • The server where the database is located
    • Database
      • The type of database AX is running against (SQL or Oracle)
  • Third tab (Figure 3)
    • DBMS_VER
      • The version of SQL Server that AX is running (please refer to the next paragraph for translating this number to something that means something)
Feel free to add to the various fields you find helpful in the comments below. I don’t want to detail them all…

When assessing what SQL Server version your current AX environment is on, look at the third tab’s DBMS_VER variable described above. You can take this number and compare it to numbers you can find online. For example, if the database is SQL Server and the DBMS_VER is 10.50.1600, try entering ‘SQL Server 10.50.16000’ in a search engine (Bing!) and you should see the server version and Service Pack version.

From my example above, using the list of versions I’ve included below, indicate that my current AX environment is running SQL Server 2008 RTM.

SQL Server 2000 version numbers:
-RTM - 8.0.194
-SP1 - 8.0.384
-SP2 - 8.0.534
-SP3 - 8.0.760.0
-SP3a - 8.0.760
-SP4 - 8.0.2039

SQL Server 2005 version number examples:
-RTM - 9.0.1399
-SP1 - 9.0.2047
-SP2 - 9.0.3042
-SP3 - 9.0.4035

SQL Server 2008 version number examples:
-RTM - 10.0.1600
-SP1 - 10.0.2531

Figure 2 – Tab one of the Database Information form
Figure 3 – Tab three of the Database Information form
Hope this helps!

Tuesday, June 28, 2011

Cycle through datasources and ranges to find values

Here is some basic code to cycle through a datasource in AX 2009 X++ and then loop through all of the data sources and their ranges and present some info to the users. Its nice for analyzing queries if something is not acting right. 

If you use this code, please leave me a comment and say thank you.  Its nice just to have someone say hi or thanks for using code like this.  If you don't use it and it helps you out, feel free to say so to.  We're all friends here :-)

// START CODE
// 2009 DAX DUDE

    int test1;
    int test2;
    int dsCount;
    int dsPlace;
    QueryBuildRange qbrTEST;
    QueryBuildDatasource qbdsTest;

    dsCount= queryRun.query().dataSourceCount();
    for (dsPlace= 1; dsPlace<= dsCount; dsPlace++)
    {
        qbdsTest = queryRun.query().dataSourceNo(dsPlace);

        test1 = qbdsTest.rangeCount();

        for (test2 = 1; test2 <= test1; test2++)
        {
            qbrTEST = qbdsTest.range(test2);

            info (strFmt("Range Field %1, Value %2", qbrTEST.AOTName(), qbrTEST.value()));
        }
    }
// END CODE

GUEST POST: Setup email alerts in DAX 2009

I have to include a reference to Nagaraj Jadhav's blog as he does a great job with all his posts.

This is a great blog around setting up email alerts in AX 2009.  I would normally try to improve upon things but I don't think I can on this one. Enjoy!

Below
http://learnax.blogspot.com/2010/12/setup-email-alerts-in-dax-2009.html

Sunday, April 24, 2011

Designing an interface queue in AX:

When I create tables that are used in the interface to hold large strings of data (like a large blob or XML from external system or AX report), I put those fields in a separate table linking to the original 'metadata' table through a unique key.  This would make the typical one table interface turn into two tables: one to hold the metadata for the user and the other to hold the large files.  

In using this design, there are many upsides but two primarily stick out that I would like to talk about:

The first is the obvious performance gain in the form used to manage the records in the interface.  When, for example, 20 records are retrieved from the database, records that do not contain an extremely large fields will come back faster.

The second is in regards to the maintenance.  A user may not need the data stored in the large fields after a few weeks but would still want to maintain the history of that data coming into the system.  To do this on a single table structure would require a cleanup job to specifically clear out the field holding the large data.  Doing this in a two table structure would allow the entire record to be deleted, but leave the original record in place.  A simple inner join between the two tables would show all records in those tables that still have the data in place.

Discuss your preferred way to do this below in the comments section...