Options

Forcing delays in Navision C/AL

m.pacanam.pacana Member Posts: 75
I currently have function in my code that makes the Navision application not respond and hangs up. But when I place a messagebox for every iteration inside the REPEAT UNTIL of the form, the execution works fine. Due to this, I guess it needs a certain delay on processing to make it work properly.

Does navision has other way to force some delays on the processing, other than using message boxes? :whistle:

Answers

  • mjrogersmjrogers Member Posts: 59
    Well, you could use the sleep command, which you can see in the online help, but it seems kind of strange that Navision would require that in most circumstances.
    TecSA Malaysia

    Those of you who think you know everything are annoying to those of us who do. -
    David Brent
  • pduckpduck Member Posts: 147
    m.pacana wrote:
    I currently have function in my code that makes the Navision application not respond and hangs up. But when I place a messagebox for every iteration inside the REPEAT UNTIL of the form, the execution works fine. Due to this, I guess it needs a certain delay on processing to make it work properly.

    Does navision has other way to force some delays on the processing, other than using message boxes? :whistle:

    What kind of function? A Dialog Update?
  • m.pacanam.pacana Member Posts: 75
    it is function inside a codeunit. It consists of the REPEAT UNTIL code and the hang ups are encountered inside the looping statement if no message box is invoked inside. 8)
  • kinekine Member Posts: 12,562
    It is strange, because Message boxes are showed at the end of the object run or on some points. Not exactly when you call the Message... :-) Only Confirm will stop the code when called. Messages are showed asynchronously...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,307
    Be careful with messagesboxes and confirms inside transactions. Those may cause the database to be locked (not the whole database of course :)).
  • kinekine Member Posts: 12,562
    Messages can lock the transacion only in pre 3.70B versions and only if they are called in Codeunit which is runned in If statement (if cu.run then...). Else messageboxes are not blocking the transaction... (the messagebox is showed after the transaction is commited...)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,307
    oh they fixed that? Message boxes are no longer holding up commits?
  • kinekine Member Posts: 12,562
    Yes, exactly, the case when Message blocked the transactions are solved in 3.70B and I assume that in 4.00 too... (may be in 4.00SP1, I do not know, if all correction from 3.70B are in 4.00...)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,307
    You learn something every day :) thanks.
  • m.pacanam.pacana Member Posts: 75
    Really? Im learning a lot from this forum :) thanks. I guess the SLEEP works fine with my function. Thanks! \:D/
Sign In or Register to comment.