Join 为什么在表SecurityRole上的Select语句中我只有标签?

Join 为什么在表SecurityRole上的Select语句中我只有标签?,join,label,axapta,dynamics-ax-2012,x++,Join,Label,Axapta,Dynamics Ax 2012,X++,我有一个小问题,为什么当我从字段SecurityRole.Name中获取值时,如果我使用join other table对表SecurityRole执行查询,我只有标签(看起来像@SYS…),我必须转换 SecurityRole securityRole; SecurityUserRole UserRole; SysUserInfo userInfo; OMUserRoleOrganization roleOrganization; OMInternalOrganization interna

我有一个小问题,为什么当我从字段SecurityRole.Name中获取值时,如果我使用join other table对表SecurityRole执行查询,我只有标签(看起来像@SYS…),我必须转换

SecurityRole securityRole;
SecurityUserRole UserRole;
SysUserInfo  userInfo;
OMUserRoleOrganization roleOrganization;
OMInternalOrganization internalOrganization;

while select ID from userInfo
    order by id asc
    outer join UserRole
    where UserRole.User == userInfo.Id
        outer join securityRole
        where securityRole.RecId == UserRole.SecurityRole
        outer join roleOrganization
        where roleOrganization.User == userInfo.Id
        && roleOrganization.SecurityRole == UserRole.SecurityRole
            outer join internalOrganization
                where internalOrganization.RecId == roleOrganization.OMInternalOrganization
    {

        print userInfo.Id, userInfo.Email, SysLabel::labelId2String(securityRole.Name), internalOrganization.Name ? internalOrganization.Name : "All Company";

        pause;
}
如果我做这样一个简单的查询:

while select securityRole
{
   info (strfmt("%1", securityRole.Name)); // here I have the really value filed - NOT the label
}
所以,我的问题是:为什么如果我用join查询securityRole,我会从字段名中得到一个标签

我知道,有一种方法可以从label(
SysLabel::labelId2String2(…)
)中获取值,但对我来说,最好从表的字段中获取真正的值

是否有一种方法可以始终获得真正的字段值(如表所示)

谢谢


享受吧

如果在select子句中明确指定字段列表,则将获得角色的名称,而不是标签:

outer join Name from securityRole
而不是

outer join securityRole