Using Navision with .net business logic layer

Hi there, I admit to being new at this Navision game, but i’ve taken a few courses on the implementation side of things, so not totally clueless. We have a situation where we are re-archetechturing a VB based product to VB.net and at the same time splitting it into a presentation layer, business logic layer and data access layer. We also have a similar product as an add-on to Navision written in c/side. The problem is that the featureset of that product has fallen behind that of the VB product and if we can avoid maintaining 2 seperate products in future it will save time / money. What I was hoping is whether it would be feasible. to: Create a front end forms interface in Navision Put a com wrapper round the .net dll Use c/side to call load functions in the dll that return a .net class (with functions, properties, etc) Script the returned objects as needed Call save on the returned object (if needed)_ Have the object either use a data access layer and the c/odbc driver to update the database, or do this through Navision somehow My real worries were: Whether the com interface would correctly marshall the class’s method / propeties to Navision. Whether the c/side language was rich enough to script objects, or is it purely procedural How best to handle the data update - i have seen a simlar discussion on this before. Any comments / feedback is welcomed, Cheers, Alex

Hello Alex, Just to let you know my experience, I wrote vb.net com object rapper around a dll. The only problem I had was sending data (string & int) between Navison and com object. The com object was using 32int or 64int and Navision was using something else. So I created an OCX wrapper in VB6 and all is works very well properties, methods, int, string the lot. As for importing data into Navision, I have always tried to use Navision tools, Dataport, reports, codeunit when ever possible, then I can use the business logic layer for validating data, and inserting data into related tables. Business login layer is not evadible using ODBC, or CFRONT. I have tried to use the KISS approach for importing and exporting data. (Some one else will have to maintain it when I’m out of the office.) Regards Graham

Hi Graham, Did you pass anything more complicated between your Navision code and your dll. The kind of thing i am thinking of is similar to: [excuse the mock navision code] theProd = loadProductFromID( prod_id) Label1 = theProd.Description if(Action = Buy) { theProd.Buy( quantity) } etc… [All the code that defined the object fruit, and filled out its methods, etc would live in the .net / com object] Just to check as well, did writing a vb6 ocx involve repeating every function / class by hand and calling through to the .net dll from there? Cheers, Alex

Hello Alex, Answer 1. I was passing strings and values and using properties. Answer 2. Yes I re-created the function in my OCX. I even created a code unit with all the OCX funcation so that all communication went through one code unit. Regards Graham

Just wanted to bump this up and see if anyone had any different opinions. Custom creating wrappers for everything isn’t really an option at the minute, given that there’s an add-in framework being developed as well. Also, any other opinions on the DB issues? Cheers, Alex