Navision Classics

Hopefully by compiling this list it will makes us (well at least me!) a slightly better developer… The purpose… Any classic things which are done in Navision and result in you feeling like an idiot… For example, Forgetting to call Rec.INSERT(TRUE) (instead calling Rec.INSERT) and spending most of your quoted time wondering why the bloody thing doesn’t work… We’ve all done it! (I hope…) Cheers A [}:)]

Okay GP… I mean Akers… When I was looking at someone else’s code to find out why a date kept changing when it shouldn’t, the only line that changed it was in an IF statement, that ran about three lines if it was true. Turned out the original developer had left out the BEGIN and END, so after the first line in the statement, the rest ran every time. Why that made me stupid? The shear amount of time it took me to see what was wrong. And I wasn’t the only guy there who couldn’t see it at first! The lines were indented as if they were in a statement - I guess that made it just ‘look’ right.

My five cents worth on spending hours and hours on understanding why my code doesn’t do what I want [;)] …a couple of Rec.SETRANGES and Rec.SETFILTER and then forgetting the Rec.FIND and wondering why the record doesn’t get loaded even if the filter on the Rec are correct and there are thousands of records that should be processed or … what about that one, e.g. in a report… IF Rec2.FIND('-') THEN REPEAT ..... UNTIL NEXT = 0; The only relieve is, this kind of errors happen once to you and never again, or at least it shouldn’t… [^] Saludos Nils

Hi

quote:


Originally posted by nilsm
…a couple of Rec.SETRANGES and Rec.SETFILTER and then forgetting the Rec.FIND and wondering why the record doesn’t get loaded even if the filter on the Rec are correct and there are thousands of records that should be processed …


YEP. IMHO this is the alltime - classic [}:)]. What about setting a key and several filters in the DataItemTableView property and then closing the form with Esc instead of selecting OK [:(]. Same behaviour in all filter forms. bye André

Hi VarFilter Text 250 User enters filter eg VarFilter := ‘a…z’; in the Code SETRANGE(Fielda,Varfilter);[:I] instead of SETFILTER(…) of course nothing found. Or Using TempTables with DELETEALL but forgetting to set the Temporary Property to YES. As Nils kind of said we should learn from our mistakes. So in that case who is going to admit to being the most Intelligent[?] [}:)]

I think i may be the only one to have done this… But what about when you want an exact copy of a dataport (for example) that you already have… And instead of opening the existing one and doing File->Save As … you spend ages making an exact copy… As i say… I am the only one who probably ever did this… DOH! [:o)]

quote:


Originally posted by stepheng
Or Using TempTables with DELETEALL but forgetting to set the Temporary Property to YES.


Ouch!!! [:D] I once did exactly this, not funny… And when you have Rec.Field := Value; but no Rec.MODIFY;? Why doesn’t it work?!? [xx(]

My standard-classic is the following : coding a codeunit, using a Flowfield without calculating it. Why to Hell you can’t see while programming what is a Flowfield and what not ???

I had a code like this: IF THEN; That semicolon caused me so headace! [B)] — In the old text-based version I used to fetch the “General Ledger Setup”-record, modified some fields and saved again. But once I forgot to GET the record first - I just initialized the record-variable, changed whatever was to change and modified. All the number-sequences and stuff was lost. And the system was up and running! [:o)]

And there’s the old one where a C/AL Global and a C/AL Local have the same name - although I soon learnt to have some kind of naming convention to avoid this. Still, it gave me one or two headaches in the early days.

This one’s a classic… Which i have actually done today… You make loads of changes in an object (which you do not realise you have opened twice…) You save the latest object first and then save the old object over it… (thinking Huh? I thought i just closed this!)… Then you test your new functionality which is no longer there! Oh how hilarious it is when this happens! [V]

quote:


Originally posted by Akers/StoneRose
Hopefully by compiling this list it will makes us (well at least me!) a slightly better developer…


I don’t think it will COMPILE… there are too many errors… [:p] But maybe it will become the biggest thread ever!

Looking at the mentioned classics I grew a lot as a developer but in the same time there’s still a lot to learn. Not directly a developer issue but while testing Purchase Invoices I never seem to be able to fill out the Vendor Invoice No. before posting???

quote:


Not directly a developer issue but while testing Purchase Invoices I never seem to be able to fill out the Vendor Invoice No. before posting???


This is a common problem. In our system we have highlighted this field yellow to remind us… [;)]

I also once spent a lot of time running a dataport in design mode and wondering why nothing was happening!! YOU LIVE AND LEARN! [:p]

And I’m the one who has to sit next to GP… I mean Akers an tell him why his code doesn’t work [:(!]

quote:


And I’m the one who has to sit next to GP… I mean Akers an tell him why his code doesn’t work


A true nightmare Stebbi, and to think he has a First Class Degree in Computing and whatever the other bit was…

I’m not as much of an illiterate fool as everyone seems to be making out! [:p][:p][:p][:p][:p][:p][:p]

Oh and for the record Kristian… I have a First Class Bachelor of Science Honours degree in Computing and Informatics… Oh and we mustn’t forget the NCR!! Haha! [}:)]

My “post” count won’t go up… Just stick’s at 107… Damn it!!!