动态表单返回数据基础资料赋值

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

动态表单返回数据基础资料赋值

## 《每天一点点》 Meutopia 单据选择动态表单中数据后,返回数据,基础资料赋值方式: dyo["F_abc_test_Id"] = (tempEntry[i] as DynamicObject)["F_abc_test"]; dyo["F_abc_test"] = BusinessDataServiceHelper.LoadSingle(this.Context, (tempEntry[i] as DynamicObject)["F_abc_test"], (this.View.BusinessInfo.GetField("F_abc_test") as BaseDataField).RefFormDynamicObjectType); 如果遇到像仓位这样的维度关联字段,略有不同as BaseDataField 换成 as RelatedFlexGroupField 就可以了 ```language //调用,动态表单 DynamicFormShowParameter formPa = new DynamicFormShowParameter(); //调用哪个表单 formPa.FormId = "abc_BDQuery"; formPa.CustomParams.Add("FBillNo", bdNumber); this.View.ShowForm(formPa, delegate (FormResult result) { //获取动态表单单据体的集合 if (result.ReturnData == null) return; DynamicObjectCollection tempEntry = ((ReturnInfo)result.ReturnData).TempEntry; //得到单据体实体 Entity entity = this.View.BillBusinessInfo.GetEntity("FEntity"); //得到单据体实体数据包 DynamicObjectCollection entityRows = (DynamicObjectCollection)this.View.Model. GetEntityDataObject(entity); //循环结果集 for (int i = 0; i < tempEntry.Count; i++) { //通过单据体实体的数据类型创建对象 DynamicObject dyo = new DynamicObject(entity.DynamicObjectType); //添加值到对象中 dyo["Seq"] = i + 1 + entityRows.Count; dyo["F_abc_test_Id"] = (tempEntry[i] as DynamicObject)["F_abc_test"]; dyo["F_abc_test"] = BusinessDataServiceHelper.LoadSingle(this.Context, (tempEntry[i] as DynamicObject)["F_abc_test"], (this.View.BusinessInfo.GetField("F_abc_test") as BaseDataField).RefFormDynamicObjectType); //将对象添加到单据体数据包中,最终显示到界面 entityRows.Add(dyo); } this.View.UpdateView("FEntity"); }); ```

动态表单返回数据基础资料赋值

## 《每天一点点》 Meutopia单据选择动态表单中数据后,返回数据,基础资料赋值方式:dyo["F_abc_test_Id"] = (tempEntry[i] as Dyna...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息