Reduce the Expression - Error

XaviXavi Member Posts: 26
we want to call a function in a dll file. we have to pass 26 parameters to the function. when we try to the call the function, the error what we get is "Reduce the Expression so it is less complex". what could be the problem? Do we have any limitation on the number of parameters we pass to a function in Navision? can it be solved?

Thanks

Xavi

Comments

  • fbfb Member Posts: 246
    There are a number of 'undocumented' limitations that we run into every once in a while -- the following come to mind:
    • The number of parameters to a function call is about ?25? (as you have discovered)
    • The number of replaceable parameters in a MESSAGE/ERROR/STRSUBSTNO format string (%1..%n) is about ?10?
    • Recursive calls are limited to a depth of about ?20?...
    Note that these numbers are 'tribal knowledge' and are likely to be wrong. They probably change over time as new C/SIDE versions are released. They may be based on some deeper limit -- ? stack size ? -- so the number may actually depend on the size/type of arguments.

    Rule of thumb: Code with abandon until you run into a limit -- then tear your hair out figuring how to avoid it...!
  • darrencdarrenc Member Posts: 16
    I was getting this same error. The function I was trying to call only had 15 parameters. I was calling the same function in other palaces in the codeunit without a problem. The code was looping though a for loop, calling the function each time. I changed the for loop to a while loop and the error went away.

    Just wanted to update the post in case this helps someone else.
    Note: Nav 4.0 (no service packs)
  • PhennoPhenno Member Posts: 630
    does anybody know what could define a size or number of parameters in function tha can be called?

    I have problem in 3.60, having 15 parameters on one function. Ofcourse, (by murphy's low) I need that 16th parameter but cannot set it cause of this "less complex" error.
Sign In or Register to comment.