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)

Changing Task Description on Batch From based on Parameter value

(0) ShareShare
ReportReport
Posted on by 355

I have a batch job that deletes integration log records. I was able to get the Task Description to show up by adding code to the Caption method to return the appropriate label. Now I want the Task Description to reflect what type of logs are being deleted based on a parameter that the user selects before submitting the job. The parameter is already there and controls what log files are processed. I added code to the Caption method to refernec the parameter value but it looks like the Task Description only gets what the value was initially set to. How can I get this value to refresh based on what the uses selects from the parameter drop down? Do I need to recall the Caption method from somewhere?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Gertjan Profile Picture
    1,200 on at

    Good evening. The caption is set in the class BatchInfo.doBatch(). If you do want to override this caption with a parameter value or other text, you could override the initBatch method. In this method the batch record is provided just before the insert. You can change the caption here using the parameters from your dialog. Good luck!

  • Steve Jung Profile Picture
    355 on at

    That didn't work.  I added the following code and it still doesn't change the task description on the batch tab when the parameter is changed on the General Tab.

    public void initBatch(Batch batch)

    {

       this.Caption();

    }

    Best Regards,

    Stephen Jung

  • Suggested answer
    Gertjan Profile Picture
    1,200 on at

    You should change this to batch.caption = this.Caption();

    In your example you are not saving the result from the this.caption() method to the batch that is inserted.

    Can you verify?

  • Steve Jung Profile Picture
    355 on at

    I made that modification but it still doesn't change the task description on the batch tab when the parameter is changed on the General Tab.

    This is the new code:

    public void initBatch(Batch batch)

    {

       batch.Caption = this.Caption();

    }

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans