通过labelid查找fieldId [英] Find fieldId through labelid

查看:73
本文介绍了通过labelid查找fieldId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问问是否可以通过字段的labelId找到特定表的fieldId.

I would like ask if it is possible to find the fieldId of a specific table through the labelId of the field.

预先感谢

推荐答案

可能的解决方案之一:

static void FindTableFieldsByLabel(Args _args)
{
    TableId         tableId     = tableNum(AccountingDistribution);
    str             findLabel   = literalStr('@SYS132687');
    SysDictTable    dictTable;
    SysDictField    dictField;
    FieldId         fieldId;

    dictTable   = new SysDictTable(tableId);
    fieldId     = dictTable.fieldNext(0);

    while (fieldId)
    {
        dictField = dictTable.fieldObject(fieldId);

        if (dictField.isSql() && !dictField.isSystem()
            && dictField.labelLabel() == findLabel)
        {
            info(strFmt('Field name: %1', dictField.name()));
        }

        fieldId = dictTable.fieldNext(fieldId);
    }

    info('Job completed');
}

如果要忽略在扩展数据类型而不是表字段上设置的标签,也可以使用 dictField.labelDefined().

You can also use dictField.labelDefined() if you want to ignore the labels set on extended data types and not on the table fields.

这篇关于通过labelid查找fieldId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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