Unable to design a codeunit...

First person to say “Have you checked your license file” will get a smack! [B)] A situation arose where a codeunit can’t be run, designed or exported as text. When we try any of the above we get get the error message “The type ‘Function’ was not defined for the function”. There is no function called ‘Function’ before you ask! I am slightly proud of this fact but… We can’t edit it to sort out the problem… Does anybody have any ideas on how we can fix this… [:(!][:D][8D][;)][:(][:0][:0][:0][:0]

I had a similar situation. In Designer I marked ALL Objects and did a COMPILE. After that the object was o.k.

Have you checked your license file? … ouch [B)] … Sorry! I have no idea on what the problem actually is, but I have also experienced something similar before. In my case, it was a Report and I was lucky enough to have a fob-backup created 5 minutes before the error started. One thing you can try is exporting the object from it’s BLOB reference and try to import it back into a new database. Maybe then you can go into design. Searching the forum for “blob object fob” will get lots of postings on how to do this. Good luck with this!

Nothing works… Damn it! [:(]

Have you checked…[:D]No, maybe I won’t go there… I have seen this error before, when I openned a copy of a 2.00 database in a higher set of executables to see if it would run, some of the objects started to behave oddly, including some that behaved the way you describe. As it happened, I dumped the database and tried something else, instead of ‘fixing’ it. I would check to see if the database is still running the same executables it was originally running. I would try the following: 1.) Replace the existing application management codeunit with the one that matches the executables. 2.) Back the database up and try to restore it into 3.70 executables. 3.) Contact MBS and ask them to advise you. 4.) Panic…

Backup restored from last night… Code re-written… Oh well… [}:)]

This is normally caused by a reference to another object changing, recompiling all objects can help, not by fixing the problem, but by giving you a better error message. A typical one is where you have a field in a table, and then create a function with the same name and return type, then delete the field and save the object. A codeunit that was previously using the field gets confused in what it is reading. Another similar issue is where you go to the Field Table directly, and rename a field to a reserved word. Also using the same control number twice in an object will mess things up. There are a number of causes for the error, and generally pretty hard to find. Best of all, you can’t export to text to find the offending object. And the error is not normally in the object you are working with. PS Here’s a good one if you want to mess up a developer for hours. Add the following field to ANY table{ 50000; ;Posting group ;Code10 ;TableRelation=Item."Inventory Posting Group" } Then try to rename an item, see how long it takes to find the error. I reported the bug in 1996.