Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How can I scheduler a 50000 level codeunit outside of NAS?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We have a codeunit that was provided by our Third Party support team that does some posting from account to account at Head Office.   For some reason this codeunit when triggered from the NAS fails but if you trigger it manually it runs successfully.   Our attempts at getting support for this have stymied, so I was hoping to institute a work around so we don't have to task a staff member with this every day.  Could anyone suggest how to trigger a codeunit like this outside of the NAS?  Something like a TSQL statement, or a SQL server agent job?   I was hoping I wouldn't have to compile anything using a program like Visual Studio...

Thanks folks.

*This post is locked for comments

  • Suggested answer
    Rabin Profile Picture
    Rabin 2,976 on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    Hi John,

    It looks like the Job is not configured well. As advised by #Suresh, you should check the error form Log Entry Page...

    But unfortunately sometime Error are misleading. So best way to configure new JOB Queue is to follow the standards...

    msdn.microsoft.com/.../hh879081(v=nav.90).aspx

    You can set the repeat cycle and test the Error again on the next run.

    --------

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    We ran the codeunit manually today,   There were some popups that would show the progress of the different operations, as well as one that would appear without an output text at the end.   We left the end one up and allowed the connection to timeout but the status showed success, and not the program returned error.   However, I believe we will move to swap the behavior of the NAS for error handling: from skip to next run to "mark with error and retry"  Since I have heard that this codeunit triggered via the NAS has had success in previous cases.    These are fantastic suggestions folks thanks for the feedback.    Suresh your strategy in troubleshooting was a good call.  I'll continue to focus on the pop-up behavior and error retry and report back next week.  thanks folks.  

  • Verified answer
    Ashwini Tripathi Profile Picture
    Ashwini Tripathi 4,624 on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    As rightly said, NAS don't like any popups like progress bar or any dialoge in between the process, it terminates the moment anything happens like this.

    Also Check the Service retry value when service fails what action to be performed set in service.

    At last check the even viever is any log is registered for failure of this service.

    If you find anything post it here which will help us finding a right answer for you by us.

  • Andrea Antoniazzi Profile Picture
    Andrea Antoniazzi 285 on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    Hi John,

    maybe you can find some error message in the event viewer of the server where the middle-tier is runnig

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    In addition to what other respectful members offered: How many retry attempts you have set? Sometimes it helps when you put several attempts to run. There might be also an option that some other processes are running at the time it tries to run, so rescheduling and increasing the number of retry attempts might solve.

  • Luc van Vugt Profile Picture
    Luc van Vugt on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    Please follow Suresh's hints and see if you can get it fixed. If not read Rashed's post how to use SQL jobs: https://naverp.wordpress.com/2009/11/14/replacing-nas-with-sql-jobs-and-nav-web-service/. We are using this heavily.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,656 on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    Is the Program Returned Error is logged in the job queue log entry as error message ? If you run it manually does it open any dialog boxes i mean any progress bars or windows showing the progress or any message boxes popup ?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    Hi Suresh,  

    I like your style!  

    The only error I have been able to see is "program returned error"   This code unit does not use other databases from other sites, so it's hard to capture what is happening when it runs with our current logging  level.   (we have a utility that can capture more robust errors but only works during that synchronization piece, when the data travels from NAV server to NAV server.)

    Can you suggest a strategy to get the output for this error message to be a bit more verbose, or perhaps is that a reflection of the way the codeunit was created?  

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,656 on at
    RE: How can I scheduler a 50000 level codeunit outside of NAS?

    John,

    What is the error message you get when you run it from NAS, maybe we can help to solve that issue and you don't have to look for other options.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,387 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans