web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Reset Production Order status to Created stage through X++ in Ax 2012R3 / D365 Finance & Operations

(0) ShareShare
ReportReport
Posted on by

Hi Everyone,

I need urgent help.

I want to reset the Production order through X++ to Created Stage.
I have written below job code in AX2012 R3 which was written on multiple blogs.
But when I try to run job facing below error,

"The status cannot be reset from Scheduled to Created on production PRD/18-19/003221 because of the parameter setup."
"Update has been canceled."

Can anybody suggest some solution on this?

Below is the logic written in Job

static void resetProductionOrder_TestJob(Args _args)
{

ProdId _prodId = "PRD/18-19/003221";
ProdMultiStatusDecrease prodMultiStatusDecrease;

ProdParmStatusDecrease prodParmStatusDecrease;

ProdTable prodTable;

Args args = new Args();

;


Try

{

ttsbegin;

prodTable = ProdTable::find(_prodId,true);

if (prodTable.ProdStatus > prodStatus::Created)

{

args.record(prodTable);

select prodParmStatusDecrease where prodParmStatusDecrease.ProdId == prodTable.ProdId;


if (!prodParmStatusDecrease.RecId)

{

prodParmStatusDecrease.clear();

prodParmStatusDecrease.initFromProdTable(prodTable);

prodParmStatusDecrease.WantedStatus = ProdStatus::Created;

prodParmStatusDecrease.ParmId = NumberSeq::newGetNum(CompanyInfo::numRefParmId()).num();

prodParmStatusDecrease.insert();

}

prodMultiStatusDecrease = prodMultiStatusDecrease::construct(args);

prodMultiStatusDecrease.initParmBuffer(prodParmStatusDecrease);

prodMultiStatusDecrease.parmId(prodParmStatusDecrease.ParmId);

prodMultiStatusDecrease.run();

}

ttsCommit;
info("Done");
}

Catch (Exception::error)

{

checkFailed(strFmt("Delete of Production order %1 is failed.", _prodId));

}

}

.Prod-Order-Error.png

Thank you in advance

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    299,149 Super User 2025 Season 2 on at
    RE: Reset Production Order status to Created stage through X++ in Ax 2012R3 / D365 Finance & Operations

    Hi Rhushikesh,

    On the production parameters, you can specify which status changes are allowed or not and if you can skip a status or not. The x++ job is validating against these parameters. It is not bypassing them.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,167

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 867 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 617 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans