SQL integiration

AJSGAJSG Member Posts: 2
Dear All,

CAn we execute a codeunit in NAV through an external SQL database? NAV is also on SQL.

Do we have to use NAS for this?

Thanks.
AJS

Comments

  • BgestelBgestel Member Posts: 136
    in order to run NAV code you need a NAV client

    A Nas is a Nav client running as a service , so you will need one.
    **********************
    ** SI ** Bert Van Gestel **
    **********************
  • garakgarak Member Posts: 3,263
    so, you need a nas.More about a NAS you can read in the manuals on product DVD or here in the Foorum.

    To call a NAV from a other server, i would use Sockets or MSQ (instead of a timer on NAS Server) and call the Socket.

    example with following:
    [url=http://NASServerIp:SomePort]http://NASServerIp:SomePort[/url]>6000/Parameter1 (Parameter1 could be some like 'CreateCustomer' or 'MakeInvoice' or what else)
    Name	DataType	Subtype	Length
    ComComIn	Automation	'Navision Communication Component version 2'.CommunicationComponent	
    SocketBAIn	Automation	'Navision Socket Bus Adapter'.SocketBusAdapter	
    
    OnRun()
    
    if (Condition) then
      Start(DefinedPortID); //for the example 6000
    
    Start(Port : Integer)
    IF ISCLEAR(ComComIn) THEN
      CREATE(ComComIn);
    
    IF ISCLEAR(SocketBAIn) THEN
      CREATE(SocketBAIn);
    
    ComComIn.AddBusAdapter(SocketBAIn,0);
    SocketBAIn.OpenSocket(Port,'');
    
    
    ComComIn::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
    
    InMsg:= InMessage;
    
    insMsg:= InMsg.GetStream();
    
    insMsg.READ(strMsg);
    
    //here you can split the parameter(s)
    //and do something .... (like case strMsg of....
    
    .....
    //Run a defined  codeunit variable
    CLEAR(NewCustomerCodeunit);
    NewCustomerCodeunit.run;
    InMsg.CommitMessage();
    

    hope understandable ;-)

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.