Error Message

sabzamsabzam Member Posts: 1,149
There is inusfficient memory (stack) to execute this function. This can be due to the way that recrusive function calls are used in the program.

I have got this error message whcih is being shown everytime I run just two lines of code in particular. These codes are simple arithmetic; has anyone got any idea the reason behind this message?

Comments

  • cnicolacnicola Member Posts: 181
    Post the code and we might be able to answer.
    Apathy is on the rise but nobody seems to care.
  • kinekine Member Posts: 12,562
    It can be problem of never ending recursive calls.

    Like
    Field 1 - OnValidate
    VALIDATE(Field2,MyValue);
    
    Field2 - OnValidate
    VALIDATE(Field1,MyValue);
    

    In this case you can use the variable CurrFieldNo to add condition that some code is called just only if the cursor is on the specific field:
    Field 1 - OnValidate
    VALIDATE(Field2,MyValue);
    
    Field2 - OnValidate
    if CurrFieldNo = FIELDNO(Field2) then
      VALIDATE(Field1,MyValue);
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,256
    To solve this. Turn on client monitor and run the process. then stop client monitor and look at client monitor for repeated code.
    Once you've found the place, put a break point and run the process again. Look at the call stack on how it gets created. Hit F5 and you'll see the callstack increasing.
    And you'll see the recursive process. Double click on lines in callstack and see what is calling what recursively.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3nara3n Member Posts: 9,256
    And btw 2.6 did not have a call stack window, and it was a bitch debugging it.

    That is one of the reason CU 90, 80, 12, are so big.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • sabzamsabzam Member Posts: 1,149
    Appartently the problem has been CurrForm.Update statement on the Modify Trigger of the Form. Does anyone know why this has been an issue since it is a not-so-heavy stmt. Just to let you know that statement was not needed since the form was updated even without this statement.
  • diptish.naskardiptish.naskar Member Posts: 360
    If you are using 4.0 you can use UpdateOnActivate property of the form to update the form instead of using the Currform.Update. (I am anot sure if this property of the form is available in the previous versions of NAV)
    Diptish Naskar
    For any queries you can also visit my blog site: http://msnavarena.blogspot.com/
Sign In or Register to comment.