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)

Howto update calling form in SysOperation framework

(0) ShareShare
ReportReport
Posted on by 4,075

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

    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
    237,976 Most Valuable Professional on at

    Which execution mode do you intend to use?

  • Rudi Hansen Profile Picture
    4,075 on at

    [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
    237,976 Most Valuable Professional on at

    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,075 on at

    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

    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,075 on at

    [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

    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…

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