AX 2012数据库 - BaseEnum到String

时间:2021-07-21 08:08:24

I am trying to Code a "while select" Statement.

我正在尝试编写“while select”语句。

I have a table "CarBrandTable" with two fields:

我有一个表“CarBrandTable”有两个字段:

CarBrandId and Countries.

CarBrandId和国家。

CarBrandId is a String. Countries is a Base Enum.

CarBrandId是一个字符串。国家是基础枚举。

Now I want to get the Data, by asking with a select Statement.

现在我想通过选择一个Statement来获取数据。

When I want to retrieve the Data by saying info(carBrandTable.countries);

当我想通过说info(carBrandTable.countries)来检索数据时;

The Compiler says... "Argument 'txt' is incompatible with the required type"

编译器说......“参数'txt'与所需的类型不兼容”

I know that my baseenum is not a string and that I hvae to somehow convert it. But I have Trouble in doing so.

我知道我的basenum不是一个字符串,而且我会以某种方式转换它。但我这样做有麻烦。

Does anybody have a tip for me ?

有人给我一个提示吗?

Thanks in advance

提前致谢

2 个解决方案

#1


3  

Rephrase the info like this:

改写这样的信息:

info(strFmt('%1', carBrandTable.countries));

#2


3  

Other way is enum2str function.

其他方式是enum2str函数。

info(enum2str(carBrandTable.countries));

#1


3  

Rephrase the info like this:

改写这样的信息:

info(strFmt('%1', carBrandTable.countries));

#2


3  

Other way is enum2str function.

其他方式是enum2str函数。

info(enum2str(carBrandTable.countries));