仓位赋值

this.View.Model.SetValue("F_RNVI_StockLocId", entryRow["F_RNVI_StockLocId"], M + Row);

if (entryRow["F_RNVI_StockLocId"] != null)
{

string stockLocld = entryRow["F_RNVI_StockLocId_Id"].ToString();

RelatedFlexGroupField stockLocFld = this.View.BusinessInfo.GetField("F_RNVI_StockLocId") as RelatedFlexGroupField;

DynamicObject[] stockLoc = BusinessDataServiceHelper.LoadFromCache(this.Context, new object[] { stockLocld }, stockLocFld.RefFormDynamicObjectType);

Entity entity = this.View.Model.BillBusinessInfo.GetEntity("FSubEntity");//单据体
DynamicObject rowObj = this.View.Model.GetEntityDataObject(entity, M + Row) as DynamicObject;
SubEntryEntity sub_entry = this.View.BillBusinessInfo.GetEntryEntity(FSubEntityKey) as SubEntryEntity;//子单据体
DynamicObject rowObj = this.View.Model.GetEntityDataObject(sub_entry, M + Row) as DynamicObject;
stockLocFld.DynamicProperty.SetValue(rowObj, stockLoc[0]);

stockLocFld.RefIDDynamicProperty.SetValue(rowObj, stockLocld);

this.View.UpdateView("F_RNVI_StockLocId", M + Row);
}

posted @ 2024-01-08 15:32  allen1991  阅读(7)  评论(0编辑  收藏  举报