I want to call a function in the codeunit through NAS

fortius_cvafortius_cva Member Posts: 70
Hi All,
I am having a function in my customized codeunit which has to be fired for every 5 min.I want to fire this fucntion without creating a session.I hope, i can do it this by using NAS....

Waiting for you valuable suggestions.......
Thank You
********
Friend Ship is just like breeze.. you can't smell it, touch it,hold it.
********

Comments

  • matttraxmatttrax Member Posts: 2,309
    The application server creates a session in Navision. If it didn't everyone would find a way to work through the app server instead of the normal interface to avoid paying for sessions :)
  • fortius_cvafortius_cva Member Posts: 70
    session is not a problem now...But Could you explain the procedure which i should follow when i want to fire the codeunit through NAS.But i want that codeunit to be fired for every 5 min...
    Thank You
    ********
    Friend Ship is just like breeze.. you can't smell it, touch it,hold it.
    ********
  • prototyperprototyper Member Posts: 70
    We have avoided NAS and use what we call Background processes for this type of thing. Basically we just run a codeunit, which we start by using windows scheduler and WINBATCH (issuing sendkeys) to open a Navision client, which has a time check running various objects at various intervals. We use this process for not only Background processing but also automation of Start of day and End of day.

    But...I am interested to know the NAS solution you adopt. Or any other ideas other ppl may have.
    Sleep on it... The best solutions come at 2am
  • kinekine Member Posts: 12,562
    Just create one singleinstance codeunit, add one global variable of type automation for class NTimer (NAV Timer), enable events on the variable, init the variable in OnRun, set appropriate properties, add code into the event and run this from NASHandler function in CU1 and you are done. 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • bbrownbbrown Member Posts: 3,268
    Look at soem of the standard features that use NAS and follow them as examples. Job Queue is a good example. Your code will likely be much simpler but the basic idea is the same.
    There are no bugs - only undocumented features.
  • fortius_cvafortius_cva Member Posts: 70
    Hi All,
    Thanks for your valuable suggestions...


    I created a new codeunit with the single instace property = yes(Ex : x) and i am calling another codeunit(Ex :y) from this x by using the Nav Timer Automation.

    I have installed the NAS on my system and i have set it up with all the necessary properties for the NAS Classic Service.

    added a new case paramater in Codeunit - 1
    CASE Parameter OF
    'MAILLOG':
    CODEUNIT.RUN(CODEUNIT::"E-Mail Dispatcher");
    'SMARTTAG':
    STPublisher.StartTimer;
    // BST 1.0 >>
    'TIMERTEMP':
    CODEUNIT.RUN(50128);
    // BST 1.0 <<


    But when i started the NAS service , i am not able to fire my x codeunit.....

    Do i really need "Message Queues" to perform the above said requirement ?

    Please suggest me some soultions on this.....
    Thank You
    ********
    Friend Ship is just like breeze.. you can't smell it, touch it,hold it.
    ********
  • kinekine Member Posts: 12,562
    Is the codeunit 50128 the singleinstance one? What does it mean "i am not able to fire my x codeunit....."? It means some error? What you can see in the event log after you try to start the NAS? Have you set the interval and enabled=true on the timer in the OnRun (the timer is disabled by default)?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • fortius_cvafortius_cva Member Posts: 70
    Hi,
    Yes,the codeunit which i said about in my previous reply is single instance one and i said "x" as just as an example..... i have dis everthing after instaling NAS and passing paramaters but i am not able to fire the NAS handler fucntion in the codeunit 1....


    Waiting for your valuable suggestions...........
    Thank You
    ********
    Friend Ship is just like breeze.. you can't smell it, touch it,hold it.
    ********
Sign In or Register to comment.