如何获取当前行集合

如想获取单据体当前行字段值,可以参看下面代码
//获取单据体或者子单据体字段值 需要先查找到相应单据体
string entityKey = "需要查找的单据体Key";
//获取单据体
var entity = this.View.BusinessInfo.GetEntryEntity(entityKey);

        //获取数据集合
        var objs = this.Model.GetEntityDataObject(entity);
        //获取单据体的当前行索引
        int entityRowIndex = this.Model.GetEntryCurrentRowIndex(entityKey);
        //方法1:GetValue根据获得的行索引取值
        this.View.Model.GetValue("单据体字段Key", entityRowIndex);
        //方法2:
        //取得单据体当前行
        DynamicObject row = objs[entityRowIndex];
        //取得当前行字段值
        var entityFieldValue = row["单据体字段Key"];

猜你喜欢

转载自blog.51cto.com/yataigp/2167628