2.2、表单插件,取值GetValue,基础资料,客户
1.1、如果有多组织,查询对应的组织;
select * from T_ORG_ORGANIZATIONS_L
1.2、再查询客户表
select * from T_BD_CUSTOMER where FUSEORGID =1
2、//把客户FcustId,赋值内码300638
this.View.Model.SetValue("FcustId", 300638);
3、重新生成
4、如果没有生效,刷新字段,并重启IIS,或者使用热更新,不用重启IIS
6、最终效果,打开销售订单,点按钮,自动获取客户
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 + "赋值成功"); //把客户FcustId,赋值内码300638 this.View.Model.SetValue("FcustId", 300638); //刷新字段 this.View.UpdateView("FNote"); this.View.UpdateView("FNote1"); this.View.UpdateView("FcustId"); } } }