Hi Bill,
Can you give me a hint on how to start a job in a specified Group? The jobname itself is not unique and exists in multiple Groups. Something like:
Group: Level-1
SubGroup: Level-2_A
Job: Job-1
Subgroup: Level-2_B
Job: Job-1
The code I'm using is like below.
When I change 'Job' to 'job = appl + "/" + region + "/" + job;', or use '\\' instead, it is not found??
Thanks Bill.
public void StartAdtempusJob(ref ListView lvMsg, ref int msgCnt, string job, bool waitResult)
{
using (DataContext context = aScheduler.NewDataContext())
{
try
{
var aJob = context.GetJob(job);
if (aJob == null)
{
msgCnt += 1;
var item4 = new ListViewItem(new[] { "(W) Job '" + job + "' not found",
msgCnt.ToString().PadLeft(4,'0') });
lvMsg.Items.Add(item4);
return;
}
var settings = new JobExecutionSettings();
settings.Options = JobExecutionOptions.ForceNewInstance;
//MessageBox.Show(aJob.JobVariables.GetVariable("Jr").ToString());
var result = aJob.Execute(settings);
if (!result.JobSubmitted)
{ ...