How to call a job in a job

teselink
Member Posts: 5
Is it possible to call a job in a job?
Example:
In the AOT/Jobs I have created a Job1 and a Job2.
Now I want to create a JobMain and in this job I want to call/run Job1 and Job2.
Does anyone have any suggestions?
Example:
In the AOT/Jobs I have created a Job1 and a Job2.
Now I want to create a JobMain and in this job I want to call/run Job1 and Job2.
Does anyone have any suggestions?
0
Comments
-
Hi,
Just a suggestion - please don't use jobs in such a manner. Instead use class. Jobs are meant for temporary tasks.
But coming to your query, you can use menuitem for calling jobs. I don't have Axapta in front of me. But it goes something like this -
MenuFunction mibuso = new MenuFunction ("<Name of job>", type);
mibuso.run();
HTH,
Harish MohanbabuHarish Mohanbabu
Long way to go before I sleep..0 -
Hi Harish,
The MenuFunction can only be used to execute the MenuItem type such as Action, Output and Display, and it can't be use to call jobs.
Please correct me if i'm wrong.
Regards,
Terabyte0 -
Hi,
Thanks for bringing this to my attention. You are right.
MenuItemType (system enum that can be found under AOT -> System Documentation -> Enums) has three elements viz., Display, Output and Action.
And in my last post, I just mentioned the syntax as -
MenuFunction mibuso = new MenuFunction ("<Name of job>", type);
mibuso.run();
which is wrong. It should actually read as -
MenuFunction mi = new MenuFunction('Job9',MenuItemType::Action);
mi.run();
Where 'Job9' is an Action type menu item. In this particular menu item, in class property, 'job' should be selected. And under 'Object' property, the appropriate job should be selected.
Apologies for my earlier post.
Regards,
Harish MohanbabuHarish Mohanbabu
Long way to go before I sleep..0 -
hi if you didn' find the solution, you can do this way.....
MainJob()
{
TreeNode treeNode = TreeNode::findNode('Jobs') ;
TreeNode tempNode;
;
tempNode = treeNode.AOTfindChild('Job1');
tempNode.AOTrun();
tempNode = treeNode.AOTfindChild('Job2');
tempNode.AOTrun();
treeNode.treeNodeRelease;
treeNode = NULL;
}
Subbu0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions