Monthly Archives: March 2009

Tip: Missing a namespace?


When using classes in certain namespaces of .NET you need to include the using statement at the top of you code. If you fail to do so the compiler won’t be able to find the class. Example: XmlDoc.Load(Path.GetDirectoryName(Assembly.GetAssembly(typeof(OCIForm)).CodeBase) + “SampleXMLFile.xml”);

Tagged with: ,
Posted in .NET

Left padding for strings in NAV


The C/AL function PADSTR will only work for padding strings to the right. Example: String AA needs to be 10 chatacters long with a padding of zeros. If the zeros need to be added to the right of the string

Tagged with: ,
Posted in NAV

Show a Modal Dialog and return a lookup


The following code snippet shows you how to return a lookup from a modal dialog. I used this code to replace a standard CRM 4 Lookup and display my own custom made lookup screen. When clicking OK in this custom

Tagged with: ,
Posted in CRM 4

Getting a filename in NAV


Here is a function to strip the Filename from it’s path in NAV. Ex: C:\Temp\Import\MyFilename.xml will become MyFilename.xml fctGetFilename(ptxtFilename : Text[1024]) ltxtFileName : Text[1024] ltxtFileName := ptxtFilename; lintSlashPos := STRPOS(ltxtFileName, ‘\’); WHILE lintSlashPos > 0 DO BEGIN    ltxtFileName :=

Tagged with: ,
Posted in NAV