问题:我在做销售订单同步的时候,要同步价目表,含税单价,及一系列的金额计算
BOSIDE里面值更新配置好的,根据客户带出价目表,根据物料带出含税单价,金额计算
部分代码:
// 构建一个IBillView实例,通过此实例,可以方便的填写物料各属性
IBillView billView = FourSDataManagerUtil.CreateBillView(ctx, "SAL_SaleOrder");
// 新建一个空白物料
// billView.CreateNewModelData();
((IBillViewService)billView).LoadData();
DynamicFormViewPlugInProxy eventProxy = billView.GetService
eventProxy.FireOnLoad();
// 填写各属性
this.FillPOInstockBillPropertys(ctx, item, billView, targetOrgId);
// 保存物料
OperateOption saveOption = OperateOption.Create();
saveOption.AddInteractionFlag(Kingdee.K3.Core.SCM.SCMConst.MinusCheckSensor);
result = FourSDataManagerUtil.SaveBill(ctx, billView, saveOption);
我看了丁老师的一个物料同步实例,说这种方法会触发值更新,插件,实体服务规则,但是现在并没有
我用了InvokeFieldUpdateService这个方法也没有触发值更新
DynamicObjectCollection Customer = DBServiceHelper.ExecuteDynamicObject(ctx, string.Format(@"select FMasterId from T_BD_CUSTOMER inner join T_BD_CUSTOMER_L
on T_BD_CUSTOMER.FCUSTID = T_BD_CUSTOMER_L.FCUSTID where T_BD_CUSTOMER_L.FNAME = '{0}' and T_BD_CUSTOMER.FUSEORGID = '{1}'", billEntitys.Customer, targetOrgId));
if (Customer.Count > 0)
{
long CustomerID = Convert.ToInt64(Customer[0]["FMasterId"]);
billView.Model.SetItemValueByID("FCustId", CustomerID, -1); //客户
DynamicObjectCollection Data = DBServiceHelper.ExecuteDynamicObject(ctx, string.Format(@"select FPRICELISTID,FDISCOUNTLISTID,FSALDEPTID,FSALGROUPID,FSELLER,FADDRESS,FPROVINCIAL,FCOUNTRY2,FPROVINCIAL1,* from T_BD_CUSTOMER
where FMasterId = {0} and T_BD_CUSTOMER.FUSEORGID = '{1}'", CustomerID, targetOrgId));
long FSALDEPTID = Convert.ToInt64(Data[0]["FSALDEPTID"]);
long FSALGROUPID = Convert.ToInt64(Data[0]["FSALGROUPID"]);
long FSELLER = Convert.ToInt64(Data[0]["FSELLER"]);
long FPRICELISTID = Convert.ToInt64(Data[0]["FPRICELISTID"]);
long FDISCOUNTLISTID = Convert.ToInt64(Data[0]["FDISCOUNTLISTID"]);
billView.Model.SetItemValueByID("FSaleDeptId", FSALDEPTID, -1); //销售部门
billView.Model.SetItemValueByID("FSaleGroupId", FSALGROUPID, -1); //销售组
billView.Model.SetItemValueByID("FSalerId", FSELLER, -1); //销售员
//billView.Model.SetItemValueByID("FPriceListId", FPRICELISTID, -1); //价目表
//billView.Model.SetItemValueByID("FDiscountListId", FDISCOUNTLISTID, -1); //折扣表
string FADDRESS = Convert.ToString(Data[0]["FADDRESS"]);
string FPROVINCIAL = Convert.ToString(Data[0]["FPROVINCIAL"]);
string FCOUNTRY2 = Convert.ToString(Data[0]["FCOUNTRY2"]);
string FPROVINCIAL1 = Convert.ToString(Data[0]["FPROVINCIAL1"]);
//billView.Model.SetValue("FNote", billEntitys.Notes); //地址
billView.Model.SetValue("F_ktj_BaseProperty", FPROVINCIAL); //地区
billView.Model.SetValue("F_ktj_BaseProperty1", FCOUNTRY2); //省份
billView.Model.SetValue("F_ktj_BaseProperty2", FPROVINCIAL1); //城市
billView.Model.SetItemValueByID("FSettleId", CustomerID, -1); //结算方
billView.Model.SetItemValueByID("FChargeId", CustomerID, -1); //付款方
}
billView.InvokeFieldUpdateService("FCustId", -1);
希望有经验的老师可以帮忙解答,项目马上交货了,很急!!!
推荐阅读