kill a single instance

is it possbile to kill a codeunit-object which is in the memory when set the “single instance” flag and the codeunit was opened once ?

Yes, just reopen the company or select a new company.

Hi

quote:


Originally posted by pduck
is it possbile to kill a codeunit-object which is in the memory when set the “single instance” flag and the codeunit was opened once ?


Doesn’t work a Clear(YourCodeUnit)? bye André

Is that true Soren? I would say you should restart Navision.

It does work. Here is a snip from the documentation:

quote:


SingleInstance When you set this property to Yes on codeunit X, all codeunit variables that use codeunit X will use the same instance. That is, all codeunit variables of codeunit X will use the same set of internal variables when the code is running on the same client. Codeunit X remains instantiated until you close the company.


Offcourse… the CompanyOpen(), LogInStart() and LogInEnd functions are in there. Navision has to reset codeunit 1 dus single instance codeunites on company change. If I’m not mistaken the reopening (without closing first) of the same company does not work.

Dear Emiel, you do a lot of thinking. Why not try it :-)?? Reopening the same company, does kill the instance of the single-instance codeunit as i wrote in my first reply.

You are quite right… It’s just that I could remember that (maybe in an early version) single instance codeunits, maybe with exception of codeunit 1, where only reset on opening a different company or closing and opening the same company. But maybe I’m mistaken. The fact is that you are right, in Attain opening the sames company is enought. As you wrote in your first reply. Sry… Wount happen again [;)]

You have to close then program (Alt+F4) or just close the database (File/Database/Close). No other way for the time beiing!

Anfinnur Hovgaard, Wich version are you talking about?

quote:


Originally posted by eromein
Anfinnur Hovgaard, Wich version are you talking about?


3.60 DK - incl all Service Packs & HotFixes [;)]