views:

683

answers:

2

Please can someone help me make sense of the Batch madness?

I'm trying to debug an Axapta 3.0 implementation that has about 50 Batch Jobs. Most of the batched classes do not implement the description() method, so when you look at the Batch List form (Basic>>Inquiries>>Batch list) the description field is blank. You can see the Batch Group and the Start Time, etc. but you can't tell which class is actually being called.

The Batch table contains a hidden field called ClassNum which identifies the ID property of the class. Can anyone tell me how I can find the corresponding class from the ID? Once I've identified the culprits I can add descriptions.

I tried using the standard Find function on the AOT but it doesn't pick them up.

Any suggestions would be most welcome!

Many thanks, Mike

+2  A: 

Jay's answer provides two comprehensive solutions.

I've just discovered that the global class ClassId2Name does the same thing, so you can simply have:

display str Classname()
{
   return ClassId2Name(this.ClassNum);    
}
A: 

There atleast two ways to do this, you can use the DictClass class:

display ClassName className()
{
    DictClass dictClass = new DictClass(this.ClassNum);
    ;
    if(dictClass!=null)
        return dictClass.name();
    return '';
}

Or using the UtilIdElements table:

display ClassName className()
{
    UtilIdElements utilIdElements;
    ;
    select utilIdElements where utilIdElements.id==this.ClassNum && utilIdElements.recordType==UtilElementType::Class;
    if(utilIdElements)
        return utilIdElements.name;
    return '';
}
Jay Hofacker