单据上加个按钮,点击调用动态表单并传一个参数过去
原单插件
else if (e.Key.EndsWith("F_PAEZ_Button1", StringComparison.OrdinalIgnoreCase))
{
Kingdee.BOS.Core.DynamicForm.DynamicFormShowParameter param = new Kingdee.BOS.Core.DynamicForm.DynamicFormShowParameter();
param.FormId = "b59582938a804d79b8d88d1c3513b98f";//【查询辅助属性启用的物料】动态表单 业务对象标识,此处动态表单、基础资料、单据类型的都可以
param.CustomParams.Add("CustomId", "10001");
this.View.ShowForm(param);
}
动态表单插件
public class dtform : AbstractBillPlugIn
{
private object _CustomId;
public override void OnInitialize(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.InitializeEventArgs e)
{
base.OnInitialize(e);
//初始化时从参数获取自定义参数
_CustomId = this.View.OpenParameter.GetCustomParameter("CustomId")
}
public override void AfterBindData(EventArgs e)
{
base.AfterBindData(e);
if (_CustomId != null)
{
//设置默认值
this.View.Model.SetValue("F_PAEZ_Text", _CustomId);
}
}
提示这个
无法将类型为“Kingdee.BOS.Web.DynamicForm.DynamicWebFormView”的对象强制转换为类型“Kingdee.BOS.Core.Bill.IBillView”
请老师看看,头一次弄
推荐阅读