Quarantine Orders – Start, Report as finished, End using X++ Code [Dynamics AX]

Friends,

Below are the snippets which will help to post the Quarantine orders [Started, Report as finished, Ended]

Basic introduction : Quarantine Management, which is part of the Inventory management module,
introduces how Microsoft Dynamics AX 2009 uses Quarantine orders to control the item location of incoming items for quality control

static void SR_QO_post_Started(Args _args)
{
InventQuarantineMultiStartUp inventQuarantineMultiStartup;
ParmBuffer parmBuffer;
ParmUpdate parmUpdate;
InventQuarantineOrder inventQuarantineOrder = InventQuarantineOrder::find(‘QO-10005’);
;
inventQuarantineMultiStartup = InventQuarantineMultiStartUp::construct();

parmBuffer = inventQuarantineMultiStartup.defaultParmBuffer();
parmUpdate = inventQuarantineMultiStartup.defaultParmUpdate();

RunBaseMultiParm::initParm(inventQuarantineMultiStartup); //sets the parm id

//init and insert update parameters that goes for all updates.
inventQuarantineMultiStartup.insertParmUpdate(parmUpdate);
parmBuffer.Linenum++;

inventQuarantineMultiStartup.insert(inventQuarantineOrder,parmBuffer);
inventQuarantineMultiStartup.run();
}

In order to post the started QO to Report as finished. Use the same logic but use the class
InventQuarantineMultiReportFinished
static void SR_QO_post_started_RAF(Args _args)
{

InventQuarantineMultiReportFinished inventQuarantineMultiReportFinished;
ParmBuffer parmBuffer;
ParmUpdate parmUpdate;
InventQuarantineOrder inventQuarantineOrder = InventQuarantineOrder::find(‘QO-10005’);
;
inventQuarantineMultiReportFinished = InventQuarantineMultiReportFinished::construct();

parmBuffer = inventQuarantineMultiReportFinished.defaultParmBuffer();
parmUpdate = inventQuarantineMultiReportFinished.defaultParmUpdate();

RunBaseMultiParm::initParm(inventQuarantineMultiReportFinished); //sets the parm id

//init and insert update parameters that goes for all updates.
InventQuarantineMultiReportFinished.insertParmUpdate(parmUpdate);
parmBuffer.Linenum++;

InventQuarantineMultiReportFinished.insert(InventQuarantineOrder,parmBuffer);
InventQuarantineMultiReportFinished.run();
}

To end the QO – use InventQuarantineMultiEnd class
static void SR_QO_post_End(Args _args)
{

InventQuarantineMultiEnd inventQuarantineMultiEnd;
ParmBuffer parmBuffer;
ParmUpdate parmUpdate;
InventQuarantineOrder inventQuarantineOrder = InventQuarantineOrder::find(‘QO-10005’);
;
;

inventQuarantineMultiEnd = InventQuarantineMultiEnd::construct();

parmBuffer = inventQuarantineMultiEnd.defaultParmBuffer();
parmUpdate = inventQuarantineMultiEnd.defaultParmUpdate();

RunBaseMultiParm::initParm(inventQuarantineMultiEnd); //sets the parm id

//init and insert update parameters that goes for all updates.
inventQuarantineMultiEnd.insertParmUpdate(parmUpdate);
parmBuffer.Linenum++;

inventQuarantineMultiEnd.insert(InventQuarantineOrder,parmBuffer);
inventQuarantineMultiEnd.run();
}

Thank you!
Happy dax6ng,
Sreenath Reddy G

Advertisements

One Response to “Quarantine Orders – Start, Report as finished, End using X++ Code [Dynamics AX]”

  1. kiran Says:

    could you pls explain me what the major difference and purpose between internal ,time and cost projects with any small example.
    why should we use time and cost projects ?
    can we map those usage in internal project directly?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: