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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to make method run on server side in D365 ?

(0) ShareShare
ReportReport
Posted on by 90

We want to make the method run even if the session is terimnated. We tried to make the class extends RunBaseBatch, but it did not work. So, how can we make the method or the class run on server side to be able to complete the code despite of anything?

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi CSafwat,

    Can you tell what exactly you mean with 'did not work'? Did you schedule the batch job via the Dynamics 365 client?

  • Suggested answer
    Deepak Agarwal Profile Picture
    8,602 on at

    Hi,

    Have you tried a method like this

    // AOSRunMode::server.

       public static server void main (Args args)

       {

           // ToDo Add method code here.

       }

    For more details refer below link

    docs.microsoft.com/.../application-object-runon-property-overview

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    The 'server' keyword has no meaning in F&O and is ignored. All X++ code runs on servers, because there is no client to run code on. (The client of F&O is a web browser.)

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    You have to submit to batch. There's specific logic trying to make sure that code gets stopped if the session is deemed to be terminated. Even if you can get this to work somehow, that would be the sort of workaround that could break in any update because it's not supposed to work (so if loopholes are found, they will likely get closed).

    Your idea to submit to batch is the way to go.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 499 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans