2.1、表单插件,赋值SetValue,文本备注原创
金蝶云社区-林荫大道cc身份
林荫大道cc
39人赞赏了该文章 18599次浏览 未经作者许可,禁止转载编辑于2023年09月09日 19:08:31
封面

续 上一节


表单插件,赋值SetValue



1、销售订单,复制新增一个字段,备注1

image.png

image.png



2、//获取备注FNote的值,并强制转换成字符串.ToString()


 string FNote = this.View.Model.GetValue("FNote").ToString();



 3、//把获取的值,给新增的字段,备注1,FNote1


this.View.Model.SetValue("FNote1", FNote + "赋值成功");




4、重新生成dll



5、如果没有生效,刷新字段,并重启IIS


            this.View.UpdateView("FNote");
            this.View.UpdateView("FNote1");


或者使用热更新,不用重启IIS

https://vip.kingdee.com/article/1361



6、最终效果,打开销售订单,点按钮,把备注的值,给备注1

image.png

image.png


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//引用
using Kingdee.BOS.Core.Bill.PlugIn;
//热启动,不用重启IIS,引用
using Kingdee.BOS;
//插件名字
using System.ComponentModel;


namespace Kingdee.Bos.ObjectName.Bill.Plugln
{
    //插件名字
    [Description("表单插件获取和设置值")]
    //热启动,不用重启IIS
    [Kingdee.BOS.Util.HotUpdate]
    
    
    //继承函数:AbstractBillPlugIn
    public class ClassName:AbstractBillPlugIn
    {
        //重写点击按钮函数
        public override void BarItemClick(BOS.Core.DynamicForm.PlugIn.Args.BarItemClickEventArgs e)
        {
            base.BarItemClick(e);
            
            
            //给单据头,备注赋值,你好
            this.View.Model.SetValue("FNote", "你好");
            
            //获取备注FNote的值,并强制转换成字符串.ToString()
            string FNote = this.View.Model.GetValue("FNote").ToString();
            
            //把获取的值,给新增的字段,备注1,FNote1
            this.View.Model.SetValue("FNote1", FNote + "赋值成功");
            
            
            //刷新字段
            this.View.UpdateView("FNote");
            this.View.UpdateView("FNote1");
        }
    }
}


总目录链接

https://vip.kingdee.com/article/64993872014591232




赞 39