This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
|
|
|
|
|
|
This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
|
Dynamics AX provides a framework, which can be used to update production orders to a specific status. In the example, a production order is started.
If you want to update several production orders at the same time, you must invoke the ProdMultiStartUp.insert() method per production order and pass the respective record of ProdTable.
{
ProdTable prodTable;
ProdMultiStartUp prodMultiStartUp;
prodTable = ProdTable::find("P000160");
prodMultiStartUp = ProdMultiStartUp::construct(new Args());
RunBaseMultiParm::initParm(prodMultiStartUp);
prodMultiStartUp.insert(prodTable, prodMultiStartUp.defaultParmBuffer());
prodMultiStartUp.run();
}
If you want to override the Default parameters, you may use the following peace of code as an example:
{
ProdTable prodTable;
ProdMultiStartUp prodMultiStartUp;
ProdParmStartUp prodParmStartUp;
ProdParmStartUp prodParmStartUpUpd;
ttsbegin;
prodTable = ProdTable::find("P000160");
prodMultiStartUp = ProdMultiStartUp::construct(new Args());
RunBaseMultiParm::initParm(prodMultiStartUp);
prodParmStartUp= prodMultiStartUp.defaultParmBuffer();
prodMultiStartUp.insert(prodTable, prodParmStartUp);
// Overwrite parameters using hardcoded settings
prodParmStartUpUpd = ProdParmStartUp::find(prodParmStartUp.ParmId, prodParmStartUp.ProdId, true);
prodParmStartUpUpd.RouteAutoConsump = RouteAutoConsump::Never;
prodParmStartUpUpd.bomAutoConsump = BOMAutoConsump::Never;
prodParmStartUpUpd.update();
prodMultiStartUp.run();
ttscommit;
}