//首先一定要添加这个强制预加载事件
public override void OnPreparePropertys(PreparePropertysEventArgs e)
{
base.OnPreparePropertys(e);
//选择自己需要的单据体字段标识进行添加
e.FieldKeys.Add("FMATERIALID"); //物料编码
e.FieldKeys.Add("FRMREALQTY"); //实退数量
e.FieldKeys.Add("FSTOCKID"); //仓库
}
public override void BeforeExecuteOperationTransaction(BeforeExecuteOperationTransaction e)
{
base.BeforeExecuteOperationTransaction(e);
//e.SelectedRows是获取你在列表钟所选的行的数据
foreach (ExtendedDataEntity dataEntity in e.SelectedRows)
{
//获取当前循环到的单据体数包
Entity entity = this.BusinessInfo.GetEntity("FPURMRBENTRY");
DynamicObject dy=dataEntity.DataEntity;
//获取单据体行集合
DynamicObjectCollection rows = entity.DynamicProperty.GetValue(dy) as DynamicObjectCollection;
}
}