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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Howto update calling form in SysOperation framework

(0) ShareShare
ReportReport
Posted on by 4,073

I have made a class that extends SysOperation, the class changes some data on SalesTable.

I am calling the class from a button on Form SalesTable, now when the class is done changing the data in SalesTable, the form does not show the change, how do i update the calling form?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Andrzej Lapinski Profile Picture
    45 on at
    RE: Howto update calling form in SysOperation framework

    Not sure if this is correct approach, have you tried to call

    reasearch method on the datasource inside the buttons clicked method ?

    public void clicked()

    {

       super();

       datasource_ds.research();

    }

  • Martin Dráb Profile Picture
    236,570 Most Valuable Professional on at
    RE: Howto update calling form in SysOperation framework

    Which execution mode do you intend to use?

  • Rudi Hansen Profile Picture
    4,073 on at
    RE: Howto update calling form in SysOperation framework

    [quote user=""Martin"]
    Which execution mode do you intend to use?
    [/quote] 

    The one that works :-)
    But i am thinking since it a pretty simple update the class does, Synchronous mode should be fine.
  • Verified answer
    Martin Dráb Profile Picture
    236,570 Most Valuable Professional on at
    RE: Howto update calling form in SysOperation framework

    In that case, what's the problem? If you do a synchronous call, the fact that the method calls the SysOperation framework is irrelevant.

    Simply wait until the method finishes and call research() or anything you need to refresh your form. If needed, look at Tutorial: refresh, reread, research, executeQuery - which one to use?.

  • Rudi Hansen Profile Picture
    4,073 on at
    RE: Howto update calling form in SysOperation framework

    Do you happen to know a class in AX that already does this?

    Easier that making my own :-)

  • Andrzej Lapinski Profile Picture
    45 on at
    RE: Howto update calling form in SysOperation framework

    Why you need a separate class just for refreshing datasource (I assume that is what you want) ? Have you tried to add research() after clicked, maybe it will be enough ?

  • Rudi Hansen Profile Picture
    4,073 on at
    RE: Howto update calling form in SysOperation framework

    [quote user=""Andrzej"][/quote]

    Why you need a separate class just for refreshing datasource (I assume that is what you want) ? Have you tried to add research() after clicked, maybe it will be enough ?

    Well this is a function i would properly like to add to more than one form, and then i would like to avoid having to also remember to add a clicked method to the button where i use it.
    And if i am not much mistaking its best practices to make functionality in classes rather than in forms.
  • Verified answer
    Andrzej Lapinski Profile Picture
    45 on at
    RE: Howto update calling form in SysOperation framework

    Fair enough.

    What about adding this line

    args.callerFormControl().dataSourceObject().research(true);

    for example inside the main method after startOperation()

    in your controlller class?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans