idiot proofing

Hi all! Is it possible to write a routine that will behave globally across all Navision tables? What I want to do is (before a row is saved to a table) verify that all dates are within a certain period of the current date. I don’t want to go into every table and point to the same codeunit in the On-Validate triggers of the fields. I’m imagining a kind of Terminate-Stay-Resident kind of function, but have no idea how to implement it. cheers,

The only way to achieve this would be to modify the MakeDateText function in codeunit 1 and simply modify it in a way that dates outsides your preferred range are not allowed to be entered. But this would also applies to birth-dates in the human ressources, filters in a statistic report or dates in a budget. Are you sure something like that is really necessary!!? Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

I was asked to look into if it was possible. The caveats you mention in this solution prohibit it’s implementation. Thanks for the reply. cheers,

Murphy’s law says: “It’s impossible to make a system idiot proof as idiots are very inventive :-)”. One of the advantages of Navision is that mistakes (e.g. wrong posting dates in invoices) are quite difficult respectively time consuming to correct. I remember a case when a user had caused a batch job to create 500 wrong invoices and the user asked for help. The official answer from Navision was simply “Let him correct the 500 invoices manually, he will take better care next time.” Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

The best solution for your situation is put checking of date in codeunits that are called for posting (80,22,12). Error messages in posting makes users nervy and it the best education for idiots :slight_smile: If error messages will popup in edit process, users will begin don’t care about correct data (PC care about that). Then error message popup in posting, makes users more careful.

You can create groups to segment users. In codeunit 1, you can modify tableno91 in fields 2 and 3. He can’t create any register in other dates.

Just a thought, but couldn’t you use the “Posting allowed from/to” fields in User setup to limit the span of dates? If the number of users isn’t too large, you can set these to i.e. the current month manually. Otherwise, you could write a fairly simple function to do it automatically for you. John

A common mistake made when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Sorry, couldn’t resist Lars Strøm Valsted Head of Project and Analysis Columbus IT Partner A/S www.columbusitpartner.com

Today Software Engineering is a race between Developers, trying to make better and idiot-proof programs, and the universe,trying to make bigger and better Idiots. So far - the Universe is winning! Benjamin Crause webmaster@amargosasun.de Germany

And another of Murpy’s laws says somthing like "If you make a idiot-proof program only idiots are going to use it!

Navision is an open database, keep it that way. Other Packages when we used to put in control code for each field fill it or go nowhere the user put in rubbish just so they could move on. “We are not fools they said!” . Put all the control you need at the time of posting, they will soon tire of correcting 500 wrong dates! David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk

quote:


Put all the control you need at the time of posting, they will soon tire of correcting 500 wrong dates!


Sorry if I disagree in this point: I believe that every checking of data has to be done at the earliest possible point. Whenever possible in the moment a user attempts to leave the field (OnValidate) Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

Marcus Quote: Sorry if I disagree in this point: I believe that every checking of data has to be done at the earliest possible point. Whenever possible in the moment a user attempts to leave the field (OnValidate) Press Escape twice and you can leave any field in Navision! End users buy into Navision software because it is flexable until the point of posting when all the required checks are done. They learn fast what the required fields are, some they fill on creation others before posting. they have dumped systems with “must fill these boxes before moving on, where the user types in any rubbish to get out of the field, then forgets to correct it” This stops say when the “External Document No.” is mandatory Invoices with a reference of “dfsdsfsdsdf” unless that is the “External Document No.” You can’t refresh dates on journals not yet posted so a large journal may be out of date range between creation and posting some still close Periods on the 1st Day of the new Period. David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk