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)

Hooking into Task End date changes on the WBS form and MSP import

(0) ShareShare
ReportReport
Posted on by 506

On the WBS form, ProjWorkBreakdownStructure, I want to undertake some actions whenever the End date changes.

However, the PSAActivitySetup.modifiedField() method is not called when the table's update() method fires  (I thought this was standard AX behaviour from the client UI).

It is called only manually via X++ calls within the guts of the controller class, ProjWBSUpdateController, but unfortunately,

(i) only for those parent tasks above the modified task, and

(ii) without the activity number attached so I cannot do a lookup within this method (even for these tasks whose End dates may change when a child task changes).

I am concerned that in order to make these customisations I will need to be very specific against forms because you can import MS Project files to update the WBS as well as using the native WBS form.

Has anyone got any experience with customisations that need to react to *any* changes to Task dates?

At the moment I'm looking to hook into ProjWBSUpdateController:

  • editTask() - hook into the Task that has changed dates
  • updateEndDateSummariesInTree() - hook into all Tasks between the the child Task changed and the root node Task
  • updateWBSOwner() - hook into a change that affects the root node Task

For MSP import I don't know where to start.

Any pointers appreciated - thanks.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    modifiedField() is called immediately when a field value changes in GUI; update() may be called much later or even not at all (it's in insert instead of update, user cancel changes or so).

    Of course, you can call the method from other places if needed, as Microsoft do in ProjWBSUpdateController. The reason is this that they change the value in code, not in GUI, therefore there is no form that would call modifiedField() automatically.

  • _MGP Profile Picture
    506 on at

    Thanks Martin.

    I couldn't figure out why modifiedField() on the table field PSAActivitySetup.PSASchedEnd wasn't firing but went looking for the answers.

    I've found after changing the field value the sequence of events bubble as follows and did breakpoints to confirm:

    data-bound field: modified() --> datasource field: modified() --> table: modifiedField()

    I got this from the Mastering AX 2012 R3 book - I'm struggling to find this on MSDN though - I got part of the story here but maybe this is freely documented by MS somewhere more obvious?

    Anyway, on the datasource field's modified() method...

    public void modified()
    {
        if (!isAutoSchedulingOn)
        {
            super();
        }
    }

    ... so when automatic scheduling assistance is switched on, super() is not called and the table's modifiedField() isn't called either as a result.

    Anyway, at least I think I understand a bit more on form events and realise why I have no option other to make mods in the controller class and wherever the code for the MSP file import might be (AxdProjWBS.doSave() ?? looks complicated..).

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