How to: Create an automation for usage in Navision

The development of a COM component with .Net for usage in Navision needs a special approach. Start with a new C# project, project type Class Library. Set the project to “Make assembly com-visible”. The simple automation provides a string property and a method to show a .net message box. // a sample code using System;… Continue reading How to: Create an automation for usage in Navision

Check windows client’s execution mode at runtime

If you want to check if the windows client is run in config mode at runtime, then there is an easy method to do that: // variables Env : DotNet : System.Environment.’mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089′ cmdArgs : DotNet : System.Array.’mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089′ // code cmdArgs := Env.GetCommandLineArgs; IF LOWERCASE(FORMAT(cmdArgs.GetValue(1))) = ‘-configure’ THEN   // do… Continue reading Check windows client’s execution mode at runtime

How to work with big item descriptions

Sometimes it’s needed to save very long descriptions, but in Nav text fields can have only 250 characters. Additional you may want to search in these long text values. You can add a couple of these text fields to save long texts or save the text in text files and add them to the item.… Continue reading How to work with big item descriptions

Mass data import

There was an issue with importing all UK post codes from a csv file, about 3m post codes. Importing using rapidstart services (excel import) can cause buffer overflow messages. excel itself has row/size limitations. Increasing MaxNoOfXMLRecordsToSend in config file ClientUserSettings.config from default value 5000 to e.g. 20000 is no problem and can help. Also changing MaxUploadSize in server… Continue reading Mass data import

ReplaceString and a new SelectString

With function ConvertStr you can replace substrings in strings. The original substring and the replacement have to have the same length. So what to do, if the length is different? Here is a solution. ReplaceString(String : Text[250];OrigSubStr : Text[100];ReplSubStr : Text[100]) : Text[250] // StartPos : Integer StartPos := STRPOS(String,OrigSubStr); WHILE StartPos > 0 DO BEGIN String… Continue reading ReplaceString and a new SelectString

Convert Tab delimited strings

I had an issue to process a csv file with TAB delimited text lines. The existing code expected text lines with ; as delimiter. Character TAB has ASCII Code 9. So i wrote following code: ConvertTabString(line : Text[250]) : Text[250] ch := 9; // of type Char line := CONVERTSTR(line,FORMAT(ch),’;’); exit(line); test code: // set… Continue reading Convert Tab delimited strings

How to display sum value in factbox on base of multiple line selection

Typical issue is to show a calculated value in a factbox on base of the currently selected line in a list page or the lines in a subpage. Is it possible to get a calculated value on base of more than one selected line? Let’s check out. Let’s say we want to display the sum… Continue reading How to display sum value in factbox on base of multiple line selection