2.1、表单插件,取值GetValue,文本备注
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
6、最终效果,打开销售订单,点按钮,把备注的值,给备注1
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"); } } }