AX 2012中批处理作业状态的可能值和文本描述是什么? [英] What are the possible values and text description for batch job status in AX 2012?

查看:136
本文介绍了AX 2012中批处理作业状态的可能值和文本描述是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个报告,以显示Microsoft AX 2012中的批处理作业问题,但是无法找到任何内容将SQL Server的BATCHJOB表中的整数状态值链接到应用程序中显示的文本描述.有人告诉我这应该存在于枚举的模型数据库中,但是我无法确定该数据库中数据之间的正确链接.我也无法在网络搜索或Microsoft提供的任何文档中找到此信息.有没有人能够提供这些值,或者告诉我在哪里可以找到它们?

I'm creating a report to show issues with batch jobs in Microsoft AX 2012, but have been unable to find anything to link the integer status values in the BATCHJOB table in SQL Server to the text description shown in the application. I was told this should exist in the model database in the enums, but I was unable to determine the proper links between the data in that database. I have also been unable to find this information in a web search or any of the documentation provided by Microsoft. Is anyone able to supply these values, or tell me where to find them?

SELECT bj.[STATUS] AS [bj_STATUS]
    -- 1: Didn't run - what else? 
    -- 2: Canceled - what else?
    -- 3: Error? 
    -- 4: Success?
    -- 5: ?
    -- 6: ?
    -- 7: ?
    -- 8: Withhold?
    -- Waiting
    -- Ended
    -- Withhold
    -- Executing
    -- Ready
    -- Finished
    -- Error
    -- Didn't run
    ,bj.[CAPTION] AS [bj_CAPTION]
    ,bjh.[STARTDATETIME] AS [bjh_STARTDATETIME]
    ,bjh.[ENDDATETIME] AS [bjh_ENDDATETIME]
    ,bjh.[BATCHCREATEDBY] AS [bjh_BATCHCREATEDBY]
    ,bjh.[CANCELEDBY] AS [bjh_CANCELEDBY]
    ,bg.[GROUP_] AS [bg_GROUP]
    ,bg.[DESCRIPTION] AS [bg_DESCRIPTION]
    ,bh.[SERVERID] AS [bh_SERVERID]
FROM [MicrosoftDynamicsAX].[dbo].[BATCHJOB] bj WITH(NOLOCK)
INNER JOIN [MicrosoftDynamicsAX].[dbo].[BATCHJOBHISTORY] bjh WITH(NOLOCK)
    ON bjh.[BATCHJOBID] = bj.[RECID] 
INNER JOIN [MicrosoftDynamicsAX].[dbo].[BATCH] b WITH(NOLOCK)
    ON b.[BATCHJOBID] = bj.[RECID] 
INNER JOIN [MicrosoftDynamicsAX].[dbo].[BATCHGROUP] bg WITH(NOLOCK)
    ON bg.[GROUP_] = b.[GROUPID] 
INNER JOIN [MicrosoftDynamicsAX].[dbo].[BATCHHISTORY] bh WITH(NOLOCK)
    ON bh.[BATCHID] = b.[RECID]
    AND bh.[BATCHJOBID] = bj.[RECID]
    AND bh.[BATCHJOBHISTORYID] = bjh.[RECID]
WHERE bjh.[STARTDATETIME] > GETDATE() - 1 -- AND bj.[STATUS] NOT IN(1, 2, 4)

推荐答案

枚举是BatchStatus,它存储在模型存储数据库中,但是我不认为存储了枚举名称和/或值.最终代表整数.

The enum is BatchStatus, which is stored in the modelstore DB, but I don't think the enum names and/or values are stored. It represents an integer ultimately.

以下是基本枚举,其整数值为0-8:

Below is the base enum with the integer values 0-8:

除了以下例外,文本标签与名称相同(英文).

The text labels are the same as the name (in English that is) except for the below exceptions.

  • 0-保留(保留)
  • 4-结束(完成)
  • 6-未运行(NotRun)

您可能只需使用CASE语句创建一个SQL存储过程,因为这些状态很少会从基本代码中更改.

You could probably just create a SQL stored procedure with a CASE statement as these statuses are rarely changed from base code.

这篇关于AX 2012中批处理作业状态的可能值和文本描述是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆