Open database

abhi1901abhi1901 Member Posts: 102
Hi,

How can we open different database from our nav coding and run codeunit in that database.

Comments

  • vaprogvaprog Member Posts: 1,141
    You may use a [url=navision://..]navision://..[/url]. URL and a form or report as an agent.
    Or set up a NAS and communicate to that NAS instance.
  • abhi1901abhi1901 Member Posts: 102
    vaprog wrote:
    You may use a [url=navision://..]navision://..[/url]. URL and a form or report as an agent.
    Or set up a NAS and communicate to that NAS instance.


    It will be really helpful if you can provide some ideas on this in detail.
  • vaprogvaprog Member Posts: 1,141
    Here is a tutorial on installing and using NAS
    Then see the documentation on the Communication Component or invent some other way to trigger the NAS to call your codeunit, e.g. you can check for a flag file in the file system or use ADO to access a database and chek a table or invent whatever messaging system you please.

    _______________________

    [url=navision://client/run?servername=localhost&company=]navision://client/run?servername=localhost&company=[/url]"CRONUS AG"&target=Report50000&requestform=0

    In Report 50000 add the following code to the OnPreReport trigger:
    IF CODEUNIT.RUN(50000) THEN
      COMMIT
    ELSE
      BEGIN
        // log error here
      END;
    // implement some way to automatically close the client here (I don't know how. Try google)
    

    I recommend the NAS over the URL thing. It's much more robust
Sign In or Register to comment.