金蝶晕云星空表单插件:操作子单据体的删除触发父单据体的字段重算

复制代码
public override void AfterDeleteRow(AfterDeleteRowEventArgs e)
{
    base.AfterDeleteRow(e);
    if (e.EntityKey.Equals(asEntityKey))//子单据体标识
    {
        Entity entity = this.View.BillBusinessInfo.GetEntity(entityKey);
        int entryCurrentRowIndex = this.Model.GetEntryCurrentRowIndex(entityKey);//获取当前父单据体选中行
        DynamicObject EntityRow = this.View.Model.GetEntityDataObject(entity, entryCurrentRowIndex); //获取当前行的信息
        //获取子单据体的信息
        DynamicObjectCollection afterEntry = EntityRow[asEntityKey] as DynamicObjectCollection;
        int qty = afterEntry.Count();
        this.View.Model.SetValue("FQty", qty, entryCurrentRowIndex);//数量 FOldQty
        this.View.InvokeFieldUpdateService("FQty", entryCurrentRowIndex);//触发数量的值更新事件
        this.View.UpdateView(entityKey);
    }
}
复制代码

 

posted @   lanrenka  阅读(66)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
点击右上角即可分享
微信分享提示