如何从类ID中识别Axapta类名?

时间:2022-06-13 05:23:43

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

请有人帮助我理解Batch疯狂吗?

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.

我正在尝试调试具有大约50个批处理作业的Axapta 3.0实现。大多数批处理类没有实现description()方法,因此当您查看批处理列表表单(基本>>查询>>批处理列表)时,描述字段为空。您可以看到批处理组和开始时间等,但您无法分辨实际调用的是哪个类。

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.

Batch表包含一个名为ClassNum的隐藏字段,用于标识类的ID属性。谁能告诉我如何从ID中找到相应的类?一旦我确定了罪魁祸首,我就可以添加说明。

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

我尝试在AOT上使用标准的查找功能,但它没有拿起它们。

Any suggestions would be most welcome!

任何建议都是最受欢迎的!

Many thanks, Mike

非常感谢,迈克

2 个解决方案

#1


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:

我刚刚发现全局类ClassId2Name做同样的事情,所以你可以简单地:

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

#2


2  

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

至少有两种方法可以做到这一点,你可以使用DictClass类:

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

Or using the UtilIdElements table:

或者使用UtilIdElements表:

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

#1


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:

我刚刚发现全局类ClassId2Name做同样的事情,所以你可以简单地:

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

#2


2  

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

至少有两种方法可以做到这一点,你可以使用DictClass类:

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

Or using the UtilIdElements table:

或者使用UtilIdElements表:

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