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)

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

(0) ShareShare
ReportReport
Posted on by 30

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
    30 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
    30 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
    30 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
    30 on at

    Thanks Chaitanya

  • @rp@n Profile Picture
    30 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

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