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)

Call Visual Studio C Sharp project in batch job

(0) ShareShare
ReportReport
Posted on by 3

Hi,

I have created one Visual Studio C Sharp project to connect external database. I have referred this http://dev.goshoom.net/en/2015/03/connection-to-external-database/. It is working fine.

I could able to call the C# Project from AX Job. It is working fine. I am trying to call the same C# project in batch job. it is not working. I have deployed C# project in both client and server (Changed to Yes in the Deploy to client and deploy to server project properties). I have done the Incremental CIL.

I referred this link for batch job creation https://community.dynamics.com/ax/b/dynamicsaxinsightbyanas/archive/2015/04/14/ax-2012-create-a-simple-batch-job

Thanks,

Hari

*This post is locked for comments

I have the same question (0)
  • Hariharans87 Profile Picture
    3 on at

    I am not getting any error message when i run the batch job.

  • Mea_ Profile Picture
    60,284 on at

    If it works from job but does not from batch usually means that it is connected to server where batch job runs. Like, do you have firewall there that blocks connection or are you using current user to access DB, because it is different for batch and job ?

    You can always debug batch job and see what is wrong https://msdn.microsoft.com/en-us/library/gg860898.aspx#BatchJobs

  • Verified answer
    Andrew Xu Profile Picture
    3,877 on at

    this issue could be caused by the data type marshalling.  when executing in job, it's running at x++, but batch job runs at CIL. please see this for details,

    [View:https://msdn.microsoft.com/en-us/library/cc584291.aspx]

  • Verified answer
    Martin Dráb Profile Picture
    237,912 Most Valuable Professional on at

    Comparing a job and a batch job sounds similar, but there is a huge amount of differences: which computer it's running on, which processor architecture it uses, which runtime environments it uses, which user account it's using...

    You should do more tests to understand which of these thing is causing the problem and which isn't.

    First run the code (as X++) in a class on server, instead of in a job on client. If it works, the next step is running it in CIL. Worry about it batch jobs only when you find that it runs correctly when executed in CIL synchronously but not in batch. Then don't forget that you can debug batch jobs.

  • Suggested answer
    JII SAADUDDIN Profile Picture
    1,832 on at

    Debugging Batch jobs using Visual Studio

    msdn.microsoft.com/.../gg860898.aspx

  • Hariharans87 Profile Picture
    3 on at

    I am not getting this error when the class is executed in client/server. I am getting this error when i run this class in batch job.

    This issue happened because of data type marshalling.

    I got this error when i try to assign date time value to AX table utcdatetime field. I tried this method Global::CLRSystemDateTime2UtcDateTime & System.DateTime data type in .net but no luck.

    I did the incremental CIL and restarted the AOS whenever i have done the changes.

    Finally, i created one table method to assign the value. I called this method in .net and assigned the values. It worked for me.

    Thank you all.

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