我需要从其他图中释放生产订单维护文档,并且在调用release.press()时,遇到数据读取器问题,请有人帮帮我,请看下面的代码
using (new PXConnectionScope())
{
ProdMaintGraph.ProdItemSelected.Current = ProdItem;
ProdMaintGraph.release.Press();
}
答案 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