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.
Answers
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?
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
Johannes Sebastian
MB7-840,MB7-841
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
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.
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...
Johannes Sebastian
MB7-840,MB7-841
Out of curiosity.... why?
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?
Johannes Sebastian
MB7-840,MB7-841
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: )
Johannes Sebastian
MB7-840,MB7-841
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>
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.
My Blog - nav.education
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.
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.
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.
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
Johannes Sebastian
MB7-840,MB7-841