Hi!
I'm studying to the C/SIDE Solution Development exam and during my studies I can't really get a grip on when to use validate.
Don't get me wrong, I know how to use validate it is more a philosophical on how often I should use it.
I have almost stopped using := instead I use validate. Sometimes it has happened that I need to write some validation code in a trigger but then I realise that the coder before haven't been using validate when given the field the value which means that I have to go through all code that has := and replace it with validate which could be a time consuming process.
In the C/SIDE Solution Development examples they mostly use := unless they know they have trigger code that want to run with validate.
What are your opinions about validate? Do you prefer it over := or do you only use it when you need it?
Hello IT, have you tried to turn it off and on?
Have you checked the cables?
Have you released the filters?http://www.navfreak.com 0
Answers
http://dynamicsuser.net/blogs/vanvugt/archive/2011/01/18/never-use-validate.aspx
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Have you checked the cables?
Have you released the filters?
http://www.navfreak.com
One very common modification is to automate certain steps, like some process that automatically creates an order based on certain parameters. I usually start with actually doing the process manually myself, and note what all happens during the process. simulating a manual process often is a series of strategically placed VALIDATE statements. You'll be amazed at how much happens automatically behind the scenes when you validate field values. Setting up a completely valid sales header for instance can be as simple as doing an INSERT(TRUE), and then validating the Sell-to Customer, the External Document number. Then on the line rarely does a user need to do more than enter an Item number and a Quantity, and maybe 1 or 2 other fields. By simply validating those fields, you can automate that process very quickly.
On the other hand, there are some functions that are called repeatedly (Quantity and Amount update functions for instance), so it pays to investigate each process and see if you can find those and change it to simple assignments. HOWEVER, if you DON'T validate, then you WILL need to take care of business logic in code. Most of the time though, VALIDATE is a very powerful tool to make sure that business logic runs properly.
RIS Plus, LLC
The article written is not good advice and I do not recommend any person taking that article seriously.
The rule is to use VALIDATE when there are coding behind the fields you're modifying. There are exceptions to the rule, but not many cases.
The order of what fields to validate is important too if you're inserting or modifying a table like item journal or general journal.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Have you checked the cables?
Have you released the filters?
http://www.navfreak.com
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community