Internal Errors

fernando_lm
fernando_lm Member Posts: 27
I have some extra code on Codeunit 1 functions LogInStart and LogInEnd:
LogInStart() 
IF rCash.READPERMISSION THEN BEGIN 
  CLEAR(POSManagement); 
  POSManagement.InitFrontOffice; 
  POSManagement.GetCash( rCash); 
  IF rCash."Cash No." <> 0 THEN BEGIN 
    cDeviceManagement.InitPoleDisplay; 
    cDeviceManagement.WritePoleDisplay(STRSUBSTNO(Txt000003,rCash."Cash No.")); 
  END; 
END; 
(...) 

LogInEnd() 
//++ERROR ESTANDAR CAR06 Cierro la caja al salir 
IF rCash.READPERMISSION THEN BEGIN 
  CLEAR(POSManagement); 
  POSManagement.GetCash( rCash); 
  IF rCash."Cash No." <> 0 THEN BEGIN 
    POSManagement.CloseCash(rCash."Cash No."); 
  END; 
END; 
//--ERROR ESTANDAR CAR06 
(...)

This code comes from an earlier version of Navision where it works fine. But on Nav5.0 it causes an error when I close the applicacion. The error comes if i run
POSManagement.GetCash( rCash);
either on LoInStart or in LogInEnd. At the end of the LogInEnd function when it runs UserTimeRegister.MODIFY two internal errors appear "Internal Error 1 on Module 5" and "Internal Error 2 on Module 7".

I've searched for this at the wiki error list and found:

Module 5 BTree (keyed index trees)
Internal Error 1 in Module 5, :: 5-1 #Err_BT_AllReadyExist (Module_BT,Err_Fatal(1))

Does anybody know how to fix this?
Does anybody know about the second internal error?

Any help will be greatly appreciated

P.S.: Sorry for my english, it's quite basic.

Comments

  • kine
    kine Member Posts: 12,562
    Have you searched the forum for the errors? I am sure that I already answered to similar problem...;-)

    Just set the variable as local instead global (or opposite). You need to define the variables on same place as other variable used in the trigger...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ta5
    ta5 Member Posts: 1,164
    We had a similar problem. Declaring some global variables as local did the trick.
    Hope this helps
    Thomas