Call Navision dataport from other programming language

sindremsindrem Member Posts: 10
edited 2011-01-05 in Navision Attain
Hey people
How can I call a Navision Dataport from an other programming language such as VB, C++ etc?

I am planning to use the pre-defined dataport SalesOrder to send orders directly from web to Navision Attain 3.6

I have tried to find such functionality in the CFRONT API. But this API seems to be more like a data layer than a business layer.

If anyone has any examples, that would be nice.

Comments

  • pduckpduck Member Posts: 147
    it doesn't work ... you can only access table data and no trigger, forms e.g. ... its the same that if you connect via odbc or something else the code in the trigger won't be run ..
  • sindremsindrem Member Posts: 10
    Hmm.. that’s really disappointing.. Anyone have any other idea on how to send a sales order directly to Navision?

    Is the only way to do this, to insert the values directly to the tables? It's quite difficult to know what tables that are related to each other, and what logic that runs in Navision.
  • pduckpduck Member Posts: 147
    what is about using the navison communication components and the application server ? this would be the solution the commerce gateway uses ... or running a batch-job which reads the orders out of a directory ?
  • sindremsindrem Member Posts: 10
    Thanks for all the input pduck. I will use Google to find some infomation about Navision communication components and application server.

    Hope it ends well :)

    Sindrem
  • andre_jackandre_jack Member Posts: 14
    Sindrem,

    you can use MSMQ or Named Pipes to send data (in any format) to a Navision Application Server waiting for input. In this way you can insert data into Navision tables running the code in the OnValidate trigger.
    You can insert data into the tables 36 and 37 to create a Sales Order and then you can post it as like you have created it form a Navision client.

    Andrea
  • GoMaDGoMaD Member Posts: 313
    It is even possible to insert data directly into a queue table via the ODBC driver. (If your Navision DB is on a SQL server, you can use the standard SQL OLE-DB driver)

    If you have a working DSN connection you can program against it like you were programming a SQL connection (with SQL statements, etc).

    Once the data is in the queue table you can process the data with the Navision Application Server (NAS)

    Greetings
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • sindremsindrem Member Posts: 10
    Yeah, that sounds like a good idea. I have just installed NAS on my machine. Hmm.. But the service wont start..

    Do I have to make queue tables for all tables related to tables 36 and 37? Or will NAS use Navisions business layer logic to solve this, and insert records to all related tables?

    This forum is really helpful!
  • GoMaDGoMaD Member Posts: 313
    The NAS needs some parameters to connect to the right database, company.

    You can find these in the pdf file that comes with the NAS.

    The best way to go about this is to write a seperate function (codeunit) that is called from the NAS and that will create the Sales Order (following the desires and wishes of the customer).
    It does not mean that you have to create a table per affected table in Navision but this must be analyzed first of course.

    But this means some programming work, because the NAS has no standard function (except maybe some parts of the Commerce Gateway) to create Sales Orders.

    Hope this helps!
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • sindremsindrem Member Posts: 10
    Yeah. The codeunit 'BizTalk Sales Invoice' seems to be something close to what I need. I hope :)

    Sindre M
  • GoMaDGoMaD Member Posts: 313
    Create a backup of this Codenunit and adjust the bakcup if you want to use this Codeunit as a basis for your own code.

    This way you can always use the Standard Commerce Gateway if you want to at a later date in the project.

    Greetings,
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • eriahieriahi Member Posts: 8
    hi evrey one ,
    Really i don't know if i m in the right forum and in the right page :) but what about create a codunit that excute this datatport and export this codeunit like a webservice , and finally acces to this webservice from other language C sharp , vb.... to exceute this dataport ??? i'm asking if this is possible ?
  • geronimogeronimo Member Posts: 90
    eriahi wrote:
    hi evrey one ,
    Really i don't know if i m in the right forum and in the right page :) but what about create a codunit that excute this datatport and export this codeunit like a webservice , and finally acces to this webservice from other language C sharp , vb.... to exceute this dataport ??? i'm asking if this is possible ?
    check here: viewtopic.php?f=32&t=45363
  • eriahieriahi Member Posts: 8
    hi geronimo,

    i have tryed this soltion but i have this error

    Codeunit50056/ExcuteExport() Line 3 : Error 7077897 : Type « Dataport » not suported.
    Codeunit50056/ExcuteExport() Line 4 : Error 7077897 : Type « Dataport » not suported.
    Codeunit50056/ExcuteExport() Line 5 : Error 7077897 : Type « Dataport » not suported.
    Codeunit50056/ExcuteExport() Line 3 : Warning 7077891 : FILENAME function is obsolete.
    Codeunit50056/ExcuteExport() Line 4 : Warning 7077891 : IMPORT function is obsolet.
    Codeunit50056/ExcuteExport() Line 5 : Warning 7077891 : RUNMODAL function is obsolet.


    if i use xml port in this case i can manipulate it coorectly by webservice but by dataport i have those exception , any idea please ?
  • eriahieriahi Member Posts: 8
    hi geronimo,

    i have tryed this soltion but i have this error

    Codeunit50056/ExcuteExport() Line 3 : Error 7077897 : Type « Dataport » not suported.
    Codeunit50056/ExcuteExport() Line 4 : Error 7077897 : Type « Dataport » not suported.
    Codeunit50056/ExcuteExport() Line 5 : Error 7077897 : Type « Dataport » not suported.
    Codeunit50056/ExcuteExport() Line 3 : Warning 7077891 : FILENAME function is obsolete.
    Codeunit50056/ExcuteExport() Line 4 : Warning 7077891 : IMPORT function is obsolet.
    Codeunit50056/ExcuteExport() Line 5 : Warning 7077891 : RUNMODAL function is obsolet.


    if i use xml port in this case i can manipulate it correctly by webservice but by dataport i have those exception , any idea please ?
  • geronimogeronimo Member Posts: 90
    check the link i posted above. in the last post it says:
    deV.ch wrote:
    Because dataports aren't supported on the NST!

    the only way you can use dataports in RTC, is with a trick : http://www.dynamicsblog.at/index.php/20 ... -xml-ports

    but i don't think that this can work when called by Webservice, but you have to try.
  • eriahieriahi Member Posts: 8
    well, I cheked the link , after some research , i found that navision does not support to acces and to run Dataport from a webservice , but widh XMLPort we can do that !! i think that we should convert dataport to a code unit , expose this codeunit like a webservice and then consume this webservice .
Sign In or Register to comment.