Filtering AOT jobs based on job properties in AX:

Hi,
The below code fetches the job names which were created between specified dates.
static void Findjobpropertieswithtime(Args _args)
{
#AOT
Treenode jobNode;
Treenode job;
job actualjob;
str createddateproperty;
str jobName;
int i;
int nodeCount;
;

jobNode = treenode::findNode(#jobsPath);
// Count of all the forms.
nodeCount = jobnode.AOTchildNodeCount();
job = jobNode.AOTfirstChild();
for (i=1; i1)
if(createddateproperty = “05.12/2012”)
{
// info(“job name is: ” + jobName,createddateproperty);
//info(strfmt(“job name and creted time: ” + jobName + ” ” + createddateproperty));
info(strfmt(“job name:” + jobName +” ” + ” creted time: ” + createddateproperty));
}
job = job.AOTnextSibling();
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s