A few development questions.

Hi, I’m quite new to the development in Navision and I have a few questions that I’d like to know a bit more about. If there are some obvious places I should visit or if you have some links where I can 1. Is it possible to list available CodeUnits/Forms/Tables much like the object browser does? 2. Is it possible to “inject” a CodeUnit in textform into the navision database programatically? 3. Examples of using NAS with TCP/IP communication, I haven’t been able to find such examples. Anyone that could point me in the right direction? Thanks in advance.

  1. Yes, take a look at Form 358 Objects, for example. There is an Object system table, where information about the objects are stored. 2) Yes, also on the Object table, there is a field BLOB Reference that can be used to either export or import objects. Note, however, that this will not export/import in the exact same file format as using the built-in Object Designer functions. 3) Try searching around the forum for NAS, you will probably find something useful. Good luck!

quote:


Originally posted by nelson
2) Yes, also on the Object table, there is a field BLOB Reference that can be used to either export or import objects. Note, however, that this will not export/import in the exact same file format as using the built-in Object Designer functions.


Doesn’t this BLOB field contain the compiled code only? I remember a thread where we discussed the import/export of objects (in text format) from within C/AL, and Jörg Stryk suggested using this field. Unfortunately, this yielded binary files only. However, Vicce seemed to ask for some sort of “self-modifying database” [:D], where some piece of C/AL code writes some other piece of C/AL code in form of a CU…

If Heinz is correct about the so-called “self-modifying database” [:D], then what I was talking about can not be used. The objects you want to import must already exist in compiled format (and they must be exported the same way they are imported, using the BLOB Reference field).

quote:


“inject” a CodeUnit in textform


I didn’t notice the textform bit, so I guess Heinz has a point and the trick I told you about is not helpful.

As Heinz correctly describes it I’m looking for a way to insert “compiled” code into the database. Is this something that is possible or maybe there isn’t any support for this kind of operation in Navision?

I’m looking at this solution because I’m in the progress of writing a small tool for Navision that would create small code-snippets that could be imported directly into the Navision database without using the Code Editor. If this solution isn’t an option, is there some other way to achieve what I’m looking for? ie. is there any way to compile code without using the built in editor?

If you want to insert code which is already compiled, then you can do it as I wrote previously. But there is no support for this kind of operation.

What you are saying is that there is no way of compiling a piece of code outside the editor? If that’s the case I’ll have to look at another solution…

So I suppose that you can not limit the number of code-snippets to a fixed number and that you really want to generate the code, compile it and then import it, correct? It wasn’t so clear for me.

Well, yes. What I’m interested in is to generate navision code (in text format) outside of Navision, and then, in some manner import the code manually into the database thus allowing navision to use it as a normal code unit. But, from the discussion we’ve had I’ve learnt that: * It IS possible to insert data (a code unit) manually into the navision database. * The code inserted MUST be in a compiled format for navision to understand and later execute the code unit. * There is no known way of compiling a code in text format outside / inside Navision without doing it manually in the editor(?).

That pretty much sums it up. [;)] The development environment in Navision simply isn’t that advanced. It’s just enough for its purpose.

Well, if you are VERY bold, you could create the program code outside Navision and then use Excel Automation and the SendKey function to simulate the manual creation and compilation of a Navision Codeunit [:0][xx(] A more realistic approach would be to let your program create a .fob file in text format and then manually import this .fob into Navision. This method is subject to license restrictions, i.e. you can not import a plain text .fob containing objects outside your licensed object ID range. Good luck [:D]