[code] String billNo = "";
MetaDataService ms = new MetaDataService();
FormMetadata fm = (FormMetadata)ms.Load(this.Context, "BD_Supplier");//供应商BD_Supplier
DynamicObjectType dt = fm.BusinessInfo.GetDynamicObjectType();
DynamicObject obj = new DynamicObject(dt);
obj["CreateOrgId_Id"] = 1L;
obj["UseOrgId_Id"] = 1L;
DynamicObject[] objs = new DynamicObject[] { obj };
Dictionary
dicParams.Add("CodeTime", 0); // 0为创建时生成, 1为保存时生成
dicParams.Add("UpdataMaxNum", true);
IBusinessDataService data_service = Kingdee.BOS.App.ServiceHelper.GetService
List
if (list != null && list.Count > 0)
{
billNo = list[0].BillNo;
}
return billNo;[/code]
通过上述代码获取的编码为空,如果将表单标识改为单据就可以正常获取到编码。
推荐阅读