How to create a crash dump for Axapta processes ?

Symptoms: All clients lose connection to the AOS Server. If the Axapta AOS or client process crashes for any reason, it is recommended to create a crash dump, of the failing process. Here are the steps to do so: Download the Microsoft debugging tools, from here: http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx The 64-bit Version is available here: http://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx Install…

4

How to execute an external process from a batch

You might need to execute an external process in a batch and you’re thinking about using WinApi::shellExecute() method. Unfortunately the whole WinApi class is set to run on client. Also the method WinApi::shellExecute() is marked as client method. That why you can’t use this method to execute an external process from batch. How to execute…

3

How to read out a Windows user SID and replace it in USERINFO table

This is needed if you are unable to log into the Axapta Client due to the following error message: “You are not a recognized user of Microsoft Dynamics AX”  Use the following Script to find the Windows user SID you want to change:strComputer = “.”Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”) Set objAccount = objWMIService.Get _   …

3

Conflict error when list of fields is used in select during update transaction

If you use this code, you will get an error on the line 29. The error message is following: Cannot edit a record in Table1 (Table1). An update conflict occurred due to another user process deleting the record or changing one or more fields in the record. 1: static void updateTable1(Args _args) 2: { 3:…

3

HOWTO: Sending mail from AX using .NET Framework.

Sometimes happen that SysMailer class (using CDO) is not the right solution for sending mails with attachments. There is a little sample of X++ Job that is using System.Net.Mail namespace to achieve same. static void JobNETSendMail(Args _args) { System.Net.Mail.MailMessage mailMessage; System.Net.Mail.Attachment attachment; System.Net.Mail.AttachmentCollection attachementCollection; System.Net.Mail.SmtpClient smtpClient; System.Net.Mail.MailAddress mailAddressFrom; System.Net.Mail.MailAddress mailAddressTo; str strBody; str strSMTPServer; str…

2

HOWTO: Dynamicaly load picture from base64 string into image on form in X++

You may want to load an image from base64 coded string. Then there is a code sample how to achieve it. First is needed to put an “Window” controll on the form with name ex. “imageWindow” and then modify “run()” method of Form. String then could be loaded from database, generated by .NET (for example…

1

Error during data migration while upgrading to AX 2009

When you’re upgrading your existing AX 3.0 SP6 environment to AX 2009 you may run into following error: Object Server 01: The database reported (session 5 (Admin)): [Microsoft][SQL Native Client][SQL Server]The specified schema name "DOMAIN\COMPUTERNAME$" either does not exist or you do not have permission to use it.. The SQL statement was: "CREATE FUNCTION [DOMAIN\COMPUTERNAME$].FN_FMT_NUMBERSEQUENCE…

1

Calling external web services from AX

While calling external web service from AX you might experience following error: Object ‘CLRObject’ could not be created This is because web services must be called from code running on server. That why you need to set the class’s RunOn property to Server or to call the web service from a method marked as server…

1

HOWTO: Using WinAPI FindFirstFile, FindNextNext in Batch Jobs.

In batch job is not posible to call WinAPI functions WINAPI::FindFirstFile(..) and WINAPI::FindNextFile(…). This is limited only for code running on client. Sometimes is necesary have similar function for code running on server (or in batches). There is a code sample which is using .NET Framework. static void Job1(Args _args) { FilePath sFilePath; System.IO.DirectoryInfo di;…

1

Blocked queries on any change in AOT

You may face a blocking issue on SQL Server each time you do any change in AOT. And you’re using database log. This is the problem. While using database log an insert trigger on SysDatabaseLog table is always dropped and recreated what is causing blocking issues on SysDatabaseLog table. There are 2 options how to…

1