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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Run on property through code and with property on same object. which one is executed first ?

(0) ShareShare
ReportReport
Posted on by 56

Dear All,

Suppose i write one class

server static boolean xcomponent()
{
       // to do
}

And also i set value RunOnProperty = Server in Menu Item. Because default is "CalledFrom"

Can you please let me know which one is executed first ?

Please give me more shed on this.

Thanks!

Arpan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    As MenuItem makes a call to the class, class RunOn property takes precedence over MenuItem RunOn property. In your case, it executes on the server tier.

  • @rp@n Profile Picture
    56 on at

    Thanks Chaitanya and Sukrurt

    I well understand what Chaitanya said.

    Sukrut you explained well but some things  are not clear for me. Can you please give me an example.

    Please give me more shed on this.

    Arpan

  • @rp@n Profile Picture
    56 on at

    Thanks Sukrut,

    So, i understand always Menu item > "RunOnProperty" take 1st priority because always any objects we are accessing through "menuitem" only.

    For example : Suppose in class " abc" having main() having
    client static void main(Args args)
    {
       // to do
    }
    and in MENU ITEM for class "abc" i set "RunonProperty = Server". So, it will execute in Server side only right?

    Note : How i will test the Object will run in Server OR Client only based on RunOnProperty (MenuItem) ?

    Please give me more shed on this.

    Arpan

  • @rp@n Profile Picture
    56 on at

    Thanks Sukrut

    How i will test the Object will execute in Server OR Client only based on RunOnProperty (MenuItem) ?

    Please give me more shed on this.

    Arpan

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    We can use the following statement to know which tier the code is running and output  will be either Client or Server.

    info(strfmt(“%1”, xGlobal::clientKind()));

  • @rp@n Profile Picture
    56 on at

    Thanks Chaitanya

  • @rp@n Profile Picture
    56 on at

    Hi Chaitanya,

    One things only "RunOn" property if i set = "Called from" then the object either execute on Client or Server.

    Note : How compiler knows the object need to execute on Client or Server. When we set RunOn property "Called from".

    Please give me more shed on this.

    Arpan

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans