web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Problems debugging batch job...

(0) ShareShare
ReportReport
Posted on by
Ok I have made all the changes as outlined here...Walkthrough: Debugging a Batch that Runs on the AOS (http://msdn.microsoft.com/en-us/library/cc588679.aspx). In short here's what I have done: - enabled global breakpoints on AOS - enabled global breakpoints on Client - set breakpoint on Client - in Admin -> Setup -> ticked isBatchServer - changed the AOS service to run in my name - Opened Debugger before adding job to batch The job gets added to the batch queue ok and I get a notification that it has successfully completed but it hasn't, hence the breakpoint. All the breakpoints are hit before the batch is added to the queue, after that they are not. What am I doing wrong? Any help with this would be much appreciated.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Sams,

    Did you try this link ?

    http://blogs.msdn.com/b/x/archive/2009/06/25/step-by-step-checklist-for-debugging-batch-jobs-in-dynamics-ax.aspx

    For me it worked :)


     

  • vsokolov Profile Picture
    45 on at

    What kind of batch job are you running? If this is an AIF job(s), then they are using runAs(..) method and this one does not allow Debugger to pop up on the breakpoint. So, a workaround in the case of using runAs() is to temporary remove runAs() and replace it with calling required methods directly using current user cridentials.

  • Community Member Profile Picture
    on at
    @Kamal Love your blog by the way. Yes I did read that article but it didn't help me. @Vitality The batch job is writing to an Excel file on SharePoint. I have run that job from a client on the AOS and that worked. Batching that same job just does not work. I was also trying to run it like an Ax 3.0 batch but that didn't work at all. Creating a new batch group, adding this job to it then processing it the process stayed at Waiting. Mmmh, back to the drawing board.
  • Community Member Profile Picture
    on at

     Thanks for your comments by the way sam. We also had a similar situation long back in AIF. We ended up struggling with debugging with the Batch Job. Finally what we decided was to create a repro of the same task without batch and try to fix the issue through that. Rather trying to get the batch stuff working...sometime this helps :)...

    So in case you can probably call that Excel stuff without the batch, try fixing the issue and then may be start trying with the batch

  • Community Member Profile Picture
    on at
    Finally got this to work as an Ax 3.0 type client batch. Still couldn't debug it so I added some code to write the infolog to a file and got this: The server-side impersonated (RunAs) session tried to invoke a method that is available for client-side processing only. Narrowed it down to opening of the Excel file, sort of makes sense. But does anyone know how I could call SysExcelWorkbooks.open() on the server side? All I did was to override runsImpersonated() to return false. Not ideal but works for know. Thanks guys for helping me out.
  • Community Member Profile Picture
    on at

     HI Sams,

    If you look all these classes[excel classes] are being run on the client. I wouldn't suggest to modify it to run on server.

    One think what you can think of is moving/copying the file from the server location to the client location and then opening it. we had one similar situation but it was with xml. From the client side we read the xml and passed it as a parameter to the server side class.

    I think what you have done is let the entire thread run on the client ??

  • Community Member Profile Picture
    on at
    Hi Kamal, I see what you mean re Excel classes. Yes, I let the entire thread run in a client side batch now because calling SysExcelWorkbooks.open() in a clientless (AOS) batch is not working. So even moving the file to the server won't help me here. Or am I missing something?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans