金蝶云星空单据编辑界面,不允许批量填充操作

发布时间 2023-12-04 17:49:45作者: lanrenka

一、案例演示
售后单,明细信息单据体,物料编码字段禁止批量填充。

 

二、开发设计
编写表单插件,在BeforeEntryBatchFill事件。

public override void BeforeEntryBatchFill(BeforeBatchFillEventArgs e)
{
    base.BeforeEntryBatchFill(e);
    //单个字段
    //if (e.FieldKey.EqualsIgnoreCase("F_XXXX_MaterialId"))
    //{
    //    e.Cancel = true;
    //    this.View.ShowMessage("物料编码字段禁止批量填充!");
    //}
    //多个字段
    switch (e.FieldKey)
    {
        case "F_XXXX_MaterialId":
            e.Cancel = true;
            this.View.ShowMessage("物料编码字段禁止批量填充!");
            break;
        case "F_XXXX_ProductLibraryId":
            e.Cancel = true;
            this.View.ShowMessage("序列号字段禁止批量填充!");
            break;
    }
         
}

 三、测试