IntelliSense under Navision Classic Client/Cside

Nav123: Navision, Showare, OrderApp

Print Friendly, PDF & Email

Well, not really "Intelli" as in "Intelli "gent. But still very fast and very helpful.
Wenn Sie bereits auf meiner Seite hier etwas gestöbert haben, stellen Sie schnell fest, das ich noch ein unverändert großer Fan der C/Side-Entwicklungsumgebung bin, auch der des Classic Clients von navision.
Und, im ernst: Ich vermisse sowohl beim Report-generator (den müssen Sie mal gesehen haben! Kein Vergleich mit dem RDLC-gemurkse von heute) wie auch bei der eigentlichen Programmierung in CSide (C/Side) praktisch nichts. Strg+f12 um im Programmcode zum Funktionsziel zu gelangen? Geht! Syntax Highlighting in C/Side? Geht! Komfortables Auswählen von Variablen & Befehlen? Geht! Nun… nicht so ganz. Die Objektauswahl im Classic Client war für mich schon immer ganz cool und auch ganz schnell, aber Autovervollständigen („Intellisense“) von C/Side der neueren Navision-versionen vermisse ich nun doch schon ein wenig in der alten Version… Geht alles trotzdem noch welten schneller als in AL, allem voran der unglaubliche Report-Generator von damals! Außer farbiger Schrift vermisse ich an dem bis heute nichts! Zum Glück kann man sich auch hier das Leben etwas vereinfachen!

Ac’tivAid (Active Aid) für das automatisierungstool AutoHotKey für C/Side!

Just use Hot Strings from the ac'tiv Aid Toolbox! You can find the version I use here:
Ac'tive Aid developer version by Michael Telgkamp?
If you are looking for even more information about the Autohotkey tool, you can find interesting places to start here:
Neue Autohokey-Version mit Qt
A good introduction is given in the C't article

What is ac'tive Aid (ac'tivAid, Active Aid, ActiveAid) or Auto-Hotkey? In very short: An easy to program script environment for own tools. Sounds familiar? Exactly! It fits perfectly with our beloved, easy to program script environment Navision and Business Central! 🙂

Screenshot feature in ac'tivAid/AutoHotKey

I also love the screenshot feature of ac'tivAid. For me, it is set so that it simply copies the current window, and opens it directly in IrfanView. There I can easily drag the desired section in full resolution, or get the drawing function with F12 and quickly mark a red box around the interesting area. Practically all screenshots on this homepage were made with it. I haven't found an easier and faster tool until today... . And I have tried many. A bit like Navision / Business Central 🙂 .

Navision or Business Central Hotstrings in ac'tivAid

Back to HotStrings and "IntelliSense" under Navision or Business Central:
Ich habe mir die schlimmsten Fingerbrecher von C/Side (CSide), wie z.B.
If rec.findset then repeat […] until = 0;

This looks then e.g. with createdatetime(workdate,time) looks like this:

Screenshot vom Ac'tivAid für Navision / Business Central am Beispiel Creadedatetime in C/Side
Screenshot of Ac'tivAid for Business Central and Navision using Createdatetime as an example

As a result, in any (!) Business Central & Navision, even in the DOS version of Navision (3.53 and 3.56), I can now simply type in the shortcut cdt( , and ac'tivAid turns it into createdatetime(workdate,time). Of course the command cdt does not work under Navision 3.5x, because it does not exist yet. But if you use the DOS-Navision, you need other commands anyway, e.g. dbFINDSET instead of rec.findset etc. Funfact: Wussten Sie, dass die Entwicklungssprache im uralten DOS Navision 3.53/3.56 auch bereits CAL bezeichnet wurde, also praktisch das AL (Application Language) von heute in Visual Studio Code?
However, the principle is the same for both and therefore works in any Navision or Business Central.

I have saved these text modules in the most frequently used variant. For example, createdatetime(workdate,time) has no semicolon at the end. I use Findfirst mostly in the variant If findfirst then…therefore I saved findfirst then . With most commands I use the opening parenthesis with it, even if it does not occur e.g. with FindFirst So I type if rec.ff( und activAid macht daraus in C/Side if rec.findfirst then : the opening bracket is deleted immediately.

Even more special is the construct used a thousand times:
if rec.findset then repeat
until = 0;

Hier benutzt man ja nun praktisch nie rec. Davon aber abgesehen hat praktisch jeder Navision oder Business Central C/Side Entwickler diese Schleife schon tausendfach eingetippt, z.B. in dieser Form:
if Cust.findset then repeat
until = 0;

(natürlich mit irgendetwas dazwischen. Und etwas abgekürzt, natürlich müsste es Customer heißen, aber „Damals“ wurden Variablen in CSide gerne noch abgekürzt. Man hatte ja nur 128, später 132 Zeichen Zeilenlänge!)

Script functions for Business Central & Navision hotstrings

Here I use the script functions of HotString from the script collection ac'tivAid for the runtime AutoHotKey:

Send ^{left}
Send ^c
Send findset then repeat
Send {Enter 2}
Send until ^v
Send .next = 0;
Send {Home}{Up}{Space}{Space}

What's the point?
I type in Navision or Business Central e.g.
if cust.fs( - nothing else.
The script first deletes the part fs(, by itself (because of the option "Replace directly (otherwise on space, Enter...)), then makes a jump to the left, copies me the RecordTeil Cust., jumps to the right again, types findset then repeat, makes a line break, and then adds partly as text, partly as content of the previously filled clipboard until = 0; .
Weil der Recordteil selber per Copy aus der C/Side Eingabe gezogen wird, ist es egal, ob ich in diesem Fall Cust eingetippt habe, es per F5 aus dem Objektmenü geholt habe oder per STRG+V aus der Zwischenablage hole.

The above script fits exactly to the C/side client up to version 2009R2. After that the jumping at the special character . has changed, so for the C/Side successor versions of Navision and Business Central, e.g. NAV 2013 or NAV 2016, it has to be adapted a bit. Using the ac'tivAid option "Only" or "Not" for program , this could even be automated to the extent that you can use the same abbreviation in the Classic C/Side client as well as in the RTC C/Side client.

Animation für das ac'tivAid Script "Findset" mit automatisch eingefügtem Records in C/Side in beide Statements für Navision / Business Central
Beispiel für das ac’tivAid Script Findset für Navision oder Business Central (C/side Entwicklungsumgebung)

So I saved the most common Business Central or Navision commands in the form I use most often:

cdt( for createdatetime(workdate,time)
ff( for findfirst then (if findfirst then)
fl( for findlast then (if findlast then)
intloop for if Number = 1 then begin... if not rec.findset then CurrReport.BREAK end else if = 0 then CurrReport.BREAK; - our favorite loop when working with Temporary Records in reports like the Article Top 10 or Debtors Top 10.
sf( for setfilter(
sr( for setrange(
sk( for setcurrentkey(
sss( for strsubstno('
tf( for testfield(
fs( for if rec.findfirst then repeat...until = 0;

More HotStrings / Hotkeys in AutoHotKey

In HotString I have even more text modules, such as my AGB's, automated texts for rejections to headhunters and various more. The advantage: You have these text modules not only in a certain program, such as Word or outlook available, but in all programs at the same time!

In allen Versionen von Business Central oder Navision mit der klassischen Entwicklungsumgebung C/Side (CSide) hilft auch dieser Userhotstring in Ac’tiveAid / Autohotkey weiter, um sehr schnell die Caption richtig zu belegen!
As a reminder: Many of us certainly use the possibility to simply label the name and the caption of a field. With this you are "in itself" also really finished, Navision can then display the caption in German, in English the name.
But this is not correct! At the latest from Navision Dynamics 2015 this laziness falls on the feet, and Navision shows in English nothing more, or continues the German Caption (has changed in between times, I think). Therefore there is only one way of working: Immediately fill the caption correctly!

Korrekt ausgefüllte Caption mit Enu in Navision bzw. Business Central klassische Entwicklungsumgebung (C/Side)
View of the properties: So it is correct with the Caption: Enu is filled!

With this UserHotkeys a breeze!

Demonstration von Ac'tive Aid beim Unterstützen von Properties (EIgenschaften) im modernen C/Side des RTC Clients

You press somewhere (!) in the captions Ctrl+F12, and Ac'tiveAid or Authotkey jumps to the top, then 2 lines down to the property Name, copy the Value there, go 2 more down, press 2 x F2 (to jump editing to the end of the Value), and paste ;enu= plus the clipboard there. No more excuses for laziness!
The Send Delay:20 is very important, otherwise Autohotkey is simply too fast for Navision and the F2 is lost!

CaptionML automatisch mit einem Tastendruck im Classic Client oder RTC Client (beide noch C/Side (Cside) Umgebung ausfüllen
Automatic filling of the CaptionML in the Classic Client with only one keystroke via activeAid or Autohotkey. Works also in the same way in the development environment of the RTC Classic Developer Client.

More hotkeys / shortcuts in Navision & Business Central C/Side

Actively use the clipboard

Use the shortcuts CTRL+G for Globals and CTRL+L for Locals. Also remember that in C/Side, just like in ClassicClient and Excel, you can scroll through the tab pages with CTRL+PICTUREUp and CTRL+PICTUREDown!
With CTRL+L (for locals) and 2 x CTRL+PICTUREDOWN you can switch to the local variable declaration in C/Side without using the mouse. Your carpal tunnel syndrome will thank you...
Disable "local" in functions? CTRL+ (Globals), 2 x CTRL+PICTUREDown (to get to the Functions page), select function, Shift+F4. Shift+F4 opens properties in the whole S/Side client. Delete yes with Local löschen, , do not overwrite with No!!

Another function, which has resulted from a customer request:
Eine automatische Umschaltung der Lizenz beim Programmstart von Navision Financials/Attain. Das braucht man z.B., wenn man sich im Umstellprozess gerade zwischen Classic Client und RTC Client befindet. Modern UI ist schon wieder etwas ganz anderes, da gibt es keine lokale Lizenz mehr, die hat dann nur der Navision Service Dienst. Man könnte das gleiche Script auch benutzen, um einfacher mit einer „zugeflogenen“ Entwicklerlizenz zu arbeiten.
Zur Erinnerung: Die fin.exe und finsql.exe nimmt als Parameter keine Licence= oder Keyboxpath= mehr an.
Zur Erinnerung: Die navin.exe vom Navision DOS 3.53, 3.56 etc konnte noch mit dem Parameter Keyboxpath=c:\temp\navi_inf.dat,serialno=Lizenznummer des Datenbankservers , and thus immediately use a different (e.g. a developer license) at startup. More about the old Navision here and hereBut even more articles on my site deal with the ingenious DOS Navision! But myself too 🙂
With Ac'tiveAid this script helps:
(to follow)