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)

Does changing a method header keyword from Server to Client require a CIL?

(0) ShareShare
ReportReport
Posted on by 7

Hi all,

Just an AX 2012 curiosity:

If you change a Class or View method with following header

private static server str MyMethod()

to

private static client str MyMethod()

Obviously, by doing this, you aim to always run it on the client tier, but would that require a cil to take effect? 

According to my current understanding, if you do not do a full or incremental CIL, but just a compile. Both client and aos will 'think' that they are responsible for running this method. Because the AOS still has the CILL code that it is run on Server. So it is based on whomever the calling code was running which will decide where it is ran.

So

if the calling class was runOn=Server => cilled code will say that the method is Server and the method is executed on Server

If ...  runOn=Client => ... executed on Client.

Curious to hear what you think and if I can get a deeper understanding. 

Thanks!

Gabriel

*This post is locked for comments

I have the same question (0)
  • Blue Wang Profile Picture
    on at

    Hi Gabriel,

    I agree with you that you need to adjust the RunOn property of the class to server or Client.

    There are also some good introductions here.

    https://amazingax.wordpress.com/2013/01/25/microsoft-dynamics-ax-2012example-of-clientserver-method-modifier/

    But I think you can't call the client method from CIL, because CIL exist only on server.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi!

    Check this link for better understanding

    axinfist.blogspot.com/.../what-is-cil-in-ax-2012.html

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Unless you generate new CIL, you still have the old one, generated from your old x++ code.

    However, assuming you run this class with a menu item, I think that CIL assembly is not used in the process which leads from menu item to your class, so it will not matter if the CIL has outdated version of this class.

    Anyway, I think you should do full x++ build and CIL generation nightly in your devbox, and after every deployment in your test system. In Prod you should deliver only modelstore, which means you do not need to do x++ build or generate CIL after code delivery.

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