老师,发货通知单增加了一个子分录,销售订单下推生成发货通知单时,子分录体中的仓库和仓位是能过赋值写入的。当销售订单下推生成发货通知单时仓库和仓位是有的,保存后再打开单据,仓库和仓位就没有。
仓库和仓位赋值代码
BaseDataField bdFld = F_SB_StockName as BaseDataField;
DynamicObject bdObj = Kingdee.BOS.ServiceHelper.BusinessDataServiceHelper.LoadSingle(this.Context,
int.Parse(ds.Tables[0].Rows[i]["F_SB_Stock"].ToString()), bdFld.RefFormDynamicObjectType);
RelatedFlexGroupField bdFld1 = F_SB_CW as RelatedFlexGroupField;
DynamicObject bdObj1 = Kingdee.BOS.ServiceHelper.BusinessDataServiceHelper.LoadSingle(this.Context,
int.Parse(ds.Tables[0].Rows[i]["F_SB_Positions"].ToString()), bdFld1.RefFormDynamicObjectType);
F_SB_StockName.DynamicProperty.SetValue(newRow, bdObj);
F_SB_CW.DynamicProperty.SetValue(newRow, bdObj1);