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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Adding multi tasks using SysOperation Framework

(0) ShareShare
ReportReport
Posted on by

Hi!

I'm trying to create to batch for the first time... and I encountered some problem...

I want to create single BatchJob which contains several Tasks...

I created DataContract :

[DataContractAttribute]
class AABatchDC
{
    str   parmStr;
}

[
    DataMemberAttribute,
    SysOperationLabelAttribute(literalStr("Label Attribute")),
    SysOperationHelpTextAttribute(literalStr("Help Text Attribute")),
    SysOperationDisplayOrderAttribute('1')
]
public str parmStr(str _parmStr = parmStr)
{
    parmStr = _parmStr;
    return parmStr;
}

and Service

class AABatchTask
{
}

[SysEntryPointAttribute(false)]
public void pr(AABatchDC _contract)
{
    AABatchTest bt;

    bt.initValue();
    bt.Field1 = strFmt("%1 : %2", _contract.parmStr(), DateTimeUtil::utcNow());
    bt.insert();
}

and MenuItem (Action) with Object "SysOperationServiceController" and Parameters "AABatchTask.pr"

Everything works fine... but every time i add new task it also create new BatchJob... ;/

How can i add several tasks to one batch ??

It will be perfect if i could choose BatchJob in Parameters...

Thank you in advance!!

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
  • Community Member Profile Picture
    on at

    Yes... it was first tutorial that i tested... The problem is that it works but create only 1 task... in background five sepered task do they work but on task list i see only one... Even if i changed to Synchronous Mode...  

  • Martin Dráb Profile Picture
    239,082 Most Valuable Professional on at

    Of course, these are runtime tasks. Maybe you want to user addTask() instead of addRuntimeTask().

    Otherwise please explain what exactly you're trying to achieve.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    I am unsure what your problem is, maybe you have implemented it incorrectly. Asynchronous runtime tasks are not persistent, they will only show up in the main batch jobs' list while they are executing, then in history they will not be there, only as separate entries.

    Changing the execution mode will also change the behavior a bit, you can read that in the documentation.

    Also as Martin has pointed out, maybe what you want is addTask, however, you did not explain that requirement.

  • Community Member Profile Picture
    on at

    I want to have one BatchJob on Job List

    When i "View tasks" i want to have several tasks for differen company (or if it's possible with different parameters)...

    I didn't know that Task and RuntimeTask are different ;/

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans