How can I identify an Axapta class Name from the class ID?
Asked Answered
R

3

5

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

Rattoon answered 7/10, 2008 at 4:47 Comment(0)
R
7

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);    
}
Rattoon answered 7/10, 2008 at 6:9 Comment(0)
R
2

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 '';
}
Rockaway answered 7/10, 2008 at 16:44 Comment(0)
I
1

Alternative to get ClassName if ClassNum is not available.

display str Classname()
{
   return classId2Name(ClassIdGet(this));  
}
Ivan answered 9/3, 2021 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.