打开DataReader相关问题

时间:2019-05-27 14:26:58

标签: acumatica

我需要从其他图中释放生产订单维护文档,并且在调用release.press()时,遇到数据读取器问题,请有人帮帮我,请看下面的代码

using (new PXConnectionScope())
 {
   ProdMaintGraph.ProdItemSelected.Current = ProdItem;
   ProdMaintGraph.release.Press();
 }

1 个答案:

答案 0 :(得分:1)

您可以调用Release(PXAdapter adapter)函数!

AMProdItem prodItem = null;//your current record
ProdMaint prodMaint = PXGraph.CreateInstance<ProdMaint>();
prodMaint.ProdMaintRecords.Current =prodMaint.ProdMaintRecords.Search<AMProdItem.orderType, AMProdItem.prodOrdID>(prodItem?.OrderType, prodItem?.ProdOrdID);
var adapterProdMaint = new PXAdapter(prodMaint.ProdMaintRecords, new string[]
  {
     prodMaint.ProdMaintRecords.Current?.OrderType,
     prodMaint.ProdMaintRecords.Current?.ProdOrdID
  }); 
prodMaint.Release(adapter);//Run 'Release Order' action 
prodMaint.ReleaseMaterial(adapter);//Run 'Release Material' action