Browse by Tags

Tagged Content List
  • Blog Post: base64Encode() of the kernel class ‘Image’ does return an empty string

    A partner asked me why the base64Encode method of the Image class does always return an empty string. In the following example: 1: Image image; 2: str sBase64Encode; 3: ; 4: image = new Image(); 5: image.loadImage(@ 'C:\sample.bmp' ); 6:   7: sBase64Encode = image.base64Encode...
  • Blog Post: RPC error 1702 when calling a WinAPI method from a batch job

    You probably already noticed that error messages are sometimes not really helpful when you are trying to understand a problem. The following code creates such misleading error message: 1: public void run() 2: { 3: ; 4: if (WinApi::folderExists( @"c:\temp\")) 5: info("Folder exists...
  • Blog Post: Enums and localization… in X++

    On Msdn enumerators (Enums) are described as: X++ does not support constants but has an enumerable type (Enum), which is a list of literals. You need to create an Enum in the Application Object Tree (AOT) before you can use it. Enum values are represented internally as integers. The first literal...
  • Blog Post: Workaround for problems with the SQL Browser in a clustered SQL Server 2000 or SQL Server 2005 (Ax4 and Ax2009)

    If you have a clustered SQL Server 2000 or SQL Server 2005 you might have the following error message: The SQLBrowser service was unable to process a client request. The cause of this problem and why this hasn’t been fixed is described on this blog. Normally, it is recommended in this case...
  • Blog Post: Ax4 + SSAS 2005 - troubleshooting

    Normally this is combination isn’t a problem – if you did everything fine directly from the beginning. If not, this could cost you quite a little time to make this working. First you must follow the pre requirements that are listed on this link for SSAS 2005 . When configuring Ax for OLAP, the server...
  • Blog Post: Changed application elements Ax2009 vs. Ax4 SP2

    This Excel spreadsheet list all application elements changed in Ax2009 since Ax4 SP2.
  • Blog Post: Passing CLR-object between an Ax-client and the AOS

    As explained on msdn you can’t pass an CLR-object between a Ax-client and the AOS. So the following example will work for the client-to-client but will fail for the client-to-server scenario: The code for the CLR-class: 1: using System; 2: 3: namespace Samples 4: { 5: public class Customer 6: ...
  • Blog Post: Handling .Net exceptions with X++

    In my last blog I was talking about casting CLR-objects in X++. In the code example you might have noticed the following code: 1: catch (Exception::CLRError) 2: { 3: //we'll discuss this later... 4: } Well, handling CLR-objects isn’t that easy. But fortunately you can find...
  • Blog Post: Casting CLR-objects with X++

    Casting CLR-objects with X++ isn’t that obvious as it is in .Net languages as C# or even VB.Net. The following code will not compile because of the incompatibility of the two types System.Net.WebRequest and System.Net.HttpWebRequest even if you are allowed to upcast in any .Net language the WebRequest...
  • Blog Post: How to implement FileSystemWatcher with X++

    The CLR offers with System.IO.FileSystemWatcher a very simple to use class which can be used with X++ in order to identify new created, renamed, deleted and changed (The change of a file or folder. The types of changes include: changes to size, attributes, security settings, last write, and last access...
  • Blog Post: Adding dynamically UserControls to a report with X++

    This is a pretty simple example how to add an UserControl to an existing Report. But since the documentation isn’t talking a lot about here’s the code: public boolean fetch() { ReportSection reportSection; ReportTextControl textControl; ; reportSection = element. design() .autoDesignSpecs(...
  • Blog Post: The Axapta-logon with the Enterprise Portal (EP)

    It’s quite important to understand how EP logs on to Ax4. Since a graphic is much easier to understand than a large text, here’s a flow diagram that shows the initialization process that happens in the Init-method of the SessionItem-class in the WebParts-assembly (a little bit simplified): An exception...
  • Blog Post: Problems with the COM-Wrapper Wizard

    I recently got the following strange error-message during the execution of the COM-wrapper wizard: "Method 'Item' in COM-object for class 'Interfaces' returned error code 0x800A0009 (<unknown>) which means: <unknown>" Debugging the wizard, I recognized that at the origin of this...
  • Blog Post: X++ in the BC.Net AppDomain and on the AOS

    As I already wrote before , the BC.Net is an Ax-client and as an Ax-client able to execute X++-code. So your X++ method are by default executed within the calling AppDomain . In order to identify the AppDomain in which the X++ is executed we write two methods (GetClientProcess and GetServerProcess...
  • Blog Post: Printer friendly EP pages – Part II

    Some days ago I presented a quite simple way to have printer friendly EP pages . Since sometimes it’s good to have different solutions here’s another solution from Anders K. Jacobsen here and here . You just have to create a new master-page (based on the EP default one) and redesign it with the Sharepoint...
  • Blog Post: Troubleshooting a simple BC.Net application

    Here's a simple checklist if you have problems to connect to the AOS (Dynamics Ax 4) with the BC.Net. Your code might look like this: 1: Microsoft.Dynamics.BusinessConnectorNet.Axapta ax; 2: string configuration = " C:\\Sample.axc " ; //see step 3 3: 4: ax = new Microsoft.Dynamics.BusinessConnectorNet...
  • Blog Post: Phantom CLR-objects with X++

    Some weeks ago I got the following code: 1: try 2: { 3: iop = new InteropPermission(InteropKind::ClrInterop); 4: iop.assert(); 5: 6: fileInfo = new System.IO.FileInfo(filename); 7: 8: if (WinAPI::fileExists(filename)) 9: { 10: fileInfo.Delete(); 11: } 12: fileInfo.Create(); 13: } 14: catch 15:...
  • Blog Post: Troubles with WinAPI in X++

    Maybe the title is some kind of misguiding, since it's neither the WinAPI nor X++ that are causing troubles, but the wrong use of the WinAPI with X++. Anyway, you might know what I mean ... Following blindly sample code from the web or the online documentation isn't always a good idea, especially...
Page 1 of 1 (18 items)