,-[原创][经验总结]用程序动态控制只有一个或少数几个字段可以改
int ret,j,i;
DictTable dictTable;
DictField DictField;
str curFieldName;
;
dictTable = new DictTable(tableNum(yourTableName));
i=dictTable.fieldCnt()-12;//这里系统会包括表的其他12个父类字段,所以减去12
for (j=1;j<=i;j++)
{
DictField=new DictField(dictTable.id(),dictTable.fieldCnt2Id(j));
curFieldName=DictField.name();
if(curFieldName!=‘Fieldname‘)
yourTableName_ds.object(DictField.id()).allowEdit(false);
else
yourTableName_ds.object(DictField.id()).allowEdit(true);
}
时间: 2024-11-05 10:57:59