Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

finalTask method in DMF custom entity class does not execute

(0) ShareShare
ReportReport
Posted on by 1,197

Hi,

I have a DMF custom entity class that extends "DMFEntityBase" and uses attribute "[DMFAttribute(true)]"

in the finalTask method I have:

public Batchable finalTask()
{
    Batchable ret;

    MyClassFinalTask     finalTask = new MyClassFinalTask();

    ret = finalTask;

    //TrackCode::insLine("MyClassFinalTask/finalTask");

    return ret;
}

This code works fine for other custom entities, I am not sure why it would not work in this case.

"MyClassFinalTask" extends "RunBaseBatch"

I have done full CIL, full compile.

Could you please suggest what is going wrong here?

*This post is locked for comments

  • Suggested answer
    Abhinay Tharwal Profile Picture
    Abhinay Tharwal 1,197 on at
    RE: finalTask method in DMF custom entity class does not execute

    Hi,

    I had forgotten to update the post here. I Ran the "Get staging data" from the DMF>Processing group which opens the "Staging data execution" form, in the entity details grid I changed the Type from default "File" to "Directory" also checked "Execute target step". After these changes the 'FinalTask" method got executed.

    Regards,

    Abhinay

  • Crispin John Augustine Profile Picture
    Crispin John Augustine 37,081 on at
    RE: finalTask method in DMF custom entity class does not execute

    There is definitely a simple solution.

    Why not call DMFEntityBase.parmStagingToTarget() with an if condition?

    I'm also curious that you mentioned "..This code works fine for other custom entities.." a slight Elaboration on this perhaps?

  • Abhinay Tharwal Profile Picture
    Abhinay Tharwal 1,197 on at
    RE: finalTask method in DMF custom entity class does not execute

    Hi Crispin,

    Thank you for your reply!

    [quote user="Crispin John Augustine"]can you share why did you use finalTask method ?[/quote][quote user="Crispin John Augustine"]this is invoked only when importing data to staging table[/quote]

    I have some business logic to execute after every attempt to import data into the staging table. So, whenever the user hits the button "Get staging data" on the "Processing group" form for my processing group, the class "MyClassFinalTask" should be run.

    Regards,

    Abhinay

  • Crispin John Augustine Profile Picture
    Crispin John Augustine 37,081 on at
    RE: finalTask method in DMF custom entity class does not execute

    can you share why did you use finalTask method ? (Keep in mind, this is invoked only when importing data to staging table, and not during staging >> target)

    (most likely there is an easier alternative within other DMF methods)

  • Abhinay Tharwal Profile Picture
    Abhinay Tharwal 1,197 on at
    RE: finalTask method in DMF custom entity class does not execute

    Any suggestions?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans