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)

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
    237,948 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

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