Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

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

Posted on by 5

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

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Does changing a method header keyword from Server to Client require a CIL?

    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.

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Does changing a method header keyword from Server to Client require a CIL?

    Hi!

    Check this link for better understanding

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

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: Does changing a method header keyword from Server to Client require a CIL?

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans