Schedule automatic popup

Johannes_NielsenJohannes_Nielsen Member Posts: 206
Hi all

We're running NAV 5.0

We have a NAS job which runs every night, and reports it's status to a custom table.

What I need is a way to ensure that someone is our organisation is reminded of the current status, so if the job fails, we would know.


Can I make a NAS job which runs a Message dialog, once a certain time a day, on a certain set of users?

(P.s. and will this require me to purchase license for a codeunit?)

Many thanks in advance and greetings from Denmark. :)
Best regards / Venlig hilsen
Johannes Sebastian
MB7-840,MB7-841

Answers

  • ShedmanShedman Member Posts: 194
    It seems impossible to me to open a form in someone elses session.

    You could program it so that it opens the newly added records in the table when you open NAV. Open the form from codeunit 1 somewhere and mark the records as shown OnCloseForm or something?
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Thank you
    Yes, I've been tinkering with CodeUnit 1, it seems that functions running a Startup i located here. (Although I've have'nt been able to find anywhere this this is described, so far..)

    But Codeunit #1 did'nt compile, so I'm reinstalling my client at the moment :-k
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • KYDutchieKYDutchie Member Posts: 345
    Johannes,

    how about sending a quick simple status report in a SMTP email through codeunit 400?
    You can do that when you write to your status table.

    Hope this helps,

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    What I need is a way to ensure that someone is our organisation is reminded of the current status, so if the job fails, we would know.

    Assign a task to someone to check the status every day. They open a form,. look at the status, and if its bad send an email to the appropriate person.
    David Singleton
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Thanks guys :!:

    I went with the Email option

    The code is done, but (I'm still new at C/AL) where is the best place to place it?

    It's in a codeunit, but it seems like a bit of a waste, to use a CU on a single function..

    (BTW: The NAS will run this) So, is it wise to place it in a "standard codeunit", and just call the specific function, via NAS?

    Im thinking, in regard to future update-procedures...
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Thanks guys :!:

    I went with the Email option

    Out of curiosity.... why?
    David Singleton
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Thanks guys :!:

    I went with the Email option

    Out of curiosity.... why?
    Sure David.

    Because we have a separate log with this particular, important, running task, in which we can ensure the results are being updated, but are reluctant to rely on busy peoples ability, to remember doing this

    So, we need an email reminder every day. (Like the ones sysadmins like me get everyday regarding backups, SPAM-filter etc.) I can see why this might seem a bit like overkill, but I makes sense to me, in this particular situation :)

    ----

    Any inputs to whether I should place the function in its own separate CodeUnit, or is that bad practice?
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Because we have a separate log with this particular, important, running task, in which we can ensure the results are being updated, but are reluctant to rely on busy peoples ability, to remember doing this

    So, we need an email reminder every day. (Like the ones sysadmins like me get everyday regarding backups, SPAM-filter etc.) I can see why this might seem a bit like overkill, but I makes sense to me, in this particular situation :)

    Well its completely the wrong solution, but I guess your mind is set, so I will stay out of the discussion at this point. :(
    Any inputs to whether I should place the function in its own separate CodeUnit, or is that bad practice?

    Put it in a new CodeUnit.
    David Singleton
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Well its completely the wrong solution, but I guess your mind is set, so I will stay out of the discussion at this point. :(

    Put it in a new CodeUnit.

    No I would really appreciate your input David. Do you know of another way, in which we could be reminded of this?

    (I'm new at modifying NAV and I won't get any good at it - if I don't listen to experience people telling me to do things differently :oops: )
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • David_SingletonDavid_Singleton Member Posts: 5,479

    Assign a task to someone to check the status every day. They open a form,. look at the status, and if its bad send an email to the appropriate person.
    David Singleton
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Out of curiosity, why do you guess that a person should do it instead of a service? That's a waste of working time, I think.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • David_SingletonDavid_Singleton Member Posts: 5,479
    It is a complex one, and of course we only know a mall fraction of the true situation. Without all the facts, the only true advise we can give is "Need more information", so if we want to comment we have to take guesses.

    There are a number of issues here.

    1/ you are asking a system to report it self when it fails. Inherently this is flawed logic. Of course we are not expecting a complete Navision crash since that would be handled by a different process, but it is still not ideal.

    2/ there is the issue of do you report success or failure. Reporting success is much easier of course, but, these days people get bombarded by email, and as well as electronic filters we also filter out data. When a user sees an email regularly and its the same information they think they are reacting to it, but actually they are ignoring it. There was a major crash of a train in Canada, and the results after showed that a major issue was that the drivers had to respond every x minutes by entering a code or pushing a button, but the same code or button. In fact they were simply entering the code by rote not by thinking so the warning message was of zero value. Same here the user will become immune to the emails and when one morning one does not come they will not notice.
    If you report failure then you have a better chance of the user responding, but it more complex to implement.

    3/ discipline and ownership. If you have employees they have jobs to do they have to do those jobs and take responsibility for doing them properly. In and ERP system some people work proactively some re-actively. Many users must have a basic morning routine and follow that routine. Some things a computer can handle some require an intelligent person to evaluate. It depends on how important the task is.

    So basically if this is a really important task and you expect that mot of the time it will run, and failure will be rare then I would not automate this, but assign a person to take responsibility.

    If on the other hand its not very critical, OR if you expect it to fail often then automate the warning.

    <note - this was getting long and I had a lot more to write, but decided to shorten the reply>
    David Singleton
  • matttraxmatttrax Member Posts: 2,309
    there is the issue of do you report success or failure. Reporting success is much easier of course, but, these days people get bombarded by email

    As someone who gets SQL Admin emails ALL THE TIME for confirmations of things executing, I can tell you that since they work most of the time, I ignore them. I would never notice if they failed unless a user complained.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Yes, that's an issue. Dull work and repeating messages might end up in a situation where no one ever notice that there's a problem. I know of one case where some users get this huge inconsistency message in NAV. The first time they get it they thought: "Oh, that's a big message. I don't have a clue about what it means, but I can't ask my admin yet because I have got other things to do." #-o Next time they get the message they tought: "Oh, that big message again! Hmm, last time I ignored it and I didn't get a problem afterwards. I will ignore it again." Thus they confirmed that message serveral times a day for about two weeks until the whole database crashed and was lost. We could only restore a two weeks old backup.

    So, I totally agree with you that this might be a problem. But I also think that most people don't think about this issue. Thus if you only guess to make a person responsible for checking the result of a process many people won't unterstand the background of your advise.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Thank you everyone for your replies and help :)
    1/ you are asking a system to report it self when it fails. Inherently this is flawed logic. Of course we are not expecting a complete Navision crash since that would be handled by a different process, but it is still not ideal.

    This is my concern as well, "NAS reporting on NAS errors" is flawed, as you say.

    Say the NAS fails all together, the email will not be sent then. The responsible persons might forget about it, for a day or two.
    But the people using this simply wanted a daily status messages.

    So basically if this is a really important task and you expect that mot of the time it will run, and failure will be rare then I would not automate this, but assign a person to take responsibility.
    If on the other hand its not very critical, OR if you expect it to fail often then automate the warning.

    Checking the log manually can be forgotten and I think I will be, some busy days, at least. So it's not better then the worst case of the Email option, I think.
    Same here the user will become immune to the emails and when one morning one does not come they will not notice.
    If you report failure then you have a better chance of the user responding, but it more complex to implement.

    The email will show entry(s) from yesterday, from Job Queue Log (we might add more jobs later on)
    Green coloring if there is no error message, otherwise Red. On daily basis the user should only see a single green entry.
    See image for example
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
Sign In or Register to comment.