Showing posts with label AX2012. Show all posts
Showing posts with label AX2012. Show all posts

Thursday, 4 September 2014

Number sequence showing 0000 after upgrade to AX2012 R2 in place.

After doing an in place upgrade from previous version of AX2012 I faced this issue:

When you have a number sequence that is set to continuous and the number that pulls into the form is 000000 and is not a valid number.

This is caused by the Stored Procedure not getting updated when the R2 in place upgrade process is complete.  We suspect that this problem may be due to incorrect steps done during the upgrade that we are not able to reproduce.

To copy out the stored procedure from a working data base you will use the following steps:
  1. Open SQL Server 
  2. Expand Databases
  3. Select your database
  4. Expand Programmability
  5. Expand Stored Procedures
  6. Right Click on dbo. getNumInternal
  7. Click Modify

 9. Select all and Copy the code form the old environment in which the number sequence was working good.

Copy the stored procedure in the R2 environment under the same stored procedure and then you can execute the code by clicking the Execute button.


Please make sure you have a backup of your data base before you try these steps.  You will need to restart the AOS and AX after you have run this code.

This will resolve your number sequence problem.

Hope this helps.

Thursday, 24 May 2012

How to merge and get vendor master/ customer master address using X++ code in AX 2012

In AX 2012 there is method formatAddress in LogisticsPostalAddress table. This method will merge all the details of the address. In my case I was updating the vendor address so I created a job as shown below:


//Something like this:

logisticsPostalAddress.Address = logisticsPostalAddress::formatAddress(logisticsPostalAddress.Street,
                    logisticsPostalAddress.ZipCode,
                    '',
                    logisticsPostalAddress.CountryRegionId,
                    '',
                    '');
logisticsPostalAddress.update();

How to reduce/flush the TempDB size in AX2012

In AX 2012 all the temp data is stored in TempDB database, which normally occupies alot of space after certain days. Below is the path for TempDB:

<YourDrive>:\SQL\MSSQL10_50.MSSQLSERVER\MSSQL\TempDB






You might see on the above path that there is a a database which is of a big size in GB's. You simply need to restart SQL Server service or restart the machine. This will flush all the temp memory from this database.

Hope this helps!