Single Instance Codeunit working as expected?

Hi! I am using a single instance codeunit (CU65000) for Navision Application Server. Now according to Navision Help this should mean that anywhere in program where i have this codeunit as variable i am using the same instance (for sure only for current client). So far i understand how this should work. Now i have the following problem. I am calling another codeunit from CU65000 with processes for example a Batch Job. Now i want to tell CU65000 which Batch Job Line is currently processed, so i can print this into a message in case of error. For this reason i made a function in CU65000 where i can set a variable called “AddErrorInformation” to type and no. of current processed report/dataport. And if an error occures and NAS jumps into Timer Error function i want to add this information to ErrorString which Navision Timer is returning. Hope you understand what i mean.

Doesn’t anyone have experience with Single Instance Codeunits??

Yes, I have quite a few S.Instance but I don’t get the picture here :S

Ok … i will try to explain it better: CU50000 is single instance (is started by NAS) CU50000 calls CU60000 CU60000 has a codeunit variable (named XY50000) which refers to CU50000 CU60000 calls a function in XY50000 which sets a global variable (named GV) in XY50000 to 5 CU60000 has finished and returns control back to CU50000 CU50000 should now have the value 5 in GV this is how i expect the program to work. But when i have tested this in Navision variable GV is always empty, after CU60000 returns control back to CU50000! As NAS keeps this CU always open i would expect that every variable refers to the same instance of this codeunit.

I think it must be: CU50000 has a codeunit variable (named XY60000) CU50000 calls XY60000.fSet(‘hoho’) CU50000 runs XY60000 XY60000 calls fGet() UseValue contains ‘hoho’ -------------------- In XY60000 fSet(parametervalue) - GValueCU50000 = parametervalue fGet() UseValue = GValueCU50000 I never tried it…