static void SetLabels(Args _args)
{
#Properties
SysDictTable dictTable = new SysDictTable(tableNum(CustTable));
SysDictField dictField;
TreeNode treeNode;
FieldId fieldId = dictTable.fieldNext(0);
str fieldName;
while (fieldId)
{
dictField = dictTable.fieldObject(fieldId);
if (dictField.isSql() && !dictField.isSystem())
{
treeNode = dictField.treeNode();
fieldName = treeNode.AOTgetProperty(#PropertyName);
treeNode.AOTsetProperty(#PropertyLabel, fieldName);
treeNode.AOTsave();
info(strFmt("Field name: %1 | Field label: %2",
treeNode.AOTgetProperty(#PropertyName), //Field name
treeNode.AOTgetProperty(#PropertyLabel))); //Field label
treeNode.treeNodeRelease();
treeNode = null;
}
fieldId = dictTable.fieldNext(fieldId);
}
}
{
#Properties
SysDictTable dictTable = new SysDictTable(tableNum(CustTable));
SysDictField dictField;
TreeNode treeNode;
FieldId fieldId = dictTable.fieldNext(0);
str fieldName;
while (fieldId)
{
dictField = dictTable.fieldObject(fieldId);
if (dictField.isSql() && !dictField.isSystem())
{
treeNode = dictField.treeNode();
fieldName = treeNode.AOTgetProperty(#PropertyName);
treeNode.AOTsetProperty(#PropertyLabel, fieldName);
treeNode.AOTsave();
info(strFmt("Field name: %1 | Field label: %2",
treeNode.AOTgetProperty(#PropertyName), //Field name
treeNode.AOTgetProperty(#PropertyLabel))); //Field label
treeNode.treeNodeRelease();
treeNode = null;
}
fieldId = dictTable.fieldNext(fieldId);
}
}
No comments:
Post a Comment