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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Report as Finished Journal

(2) ShareShare
ReportReport
Posted on by 69
Hi community, 

   I need to update the production order status from started to Report as Finished
//[SysODataActionAttribute("YSReportAsFinished", false)]
//public static void YSReportAsFinished(ProdId productid)
//{
//    ProdTable               prodTable;
//    ProdParmReportFinished  prodParmReportFinished;
//    ProdUpdReportFinished   prodUpdReportFinished;
//    prodTable = ProdTable::find(productid, true);
//    if (!prodTable)
//    {
//        throw error(strFmt(
//        "Production order %1 not found.",
//        productid));
//    }

//    if (prodTable.ProdStatus != ProdStatus::StartedUp)
//    {
//        throw error(strFmt(
//        "Production order %1 must be in Started status. Current status: %2",
//        productid,
//        enum2Str(prodTable.ProdStatus)));
//    }
//    ttsbegin;

//    prodParmReportFinished.clear();
//    prodParmReportFinished.ParmBuffer::initParmId();
//    prodParmReportFinished.initParmDefault();
//    prodParmReportFinished.initFromProdTable(prodTable);
//    prodParmReportFinished.ProdId  = productid;

//    prodParmReportFinished.QtyGood =
//    ProdUpdReportFinished::proposalQtyGood(productid);
//    prodParmReportFinished.EndJob  = NoYes::No;
//    prodParmReportFinished.PostNow = NoYes::Yes;
//    prodParmReportFinished.insert();

//    prodUpdReportFinished =
//    ProdUpdReportFinished::newParmBuffer(prodParmReportFinished);
//    prodUpdReportFinished.run();
//    ttscommit;
//}
I have used this code, however it is created and posted the RAF journal for formula only not for coproduct or a byproduct

I need a journal which is replicated a standard behaviour
I have the same question (1)
  • Laurens vd Tang Profile Picture
    4,250 Super User 2026 Season 1 on at
    Good day,
     
    Do you mean that the co/by product isn't part of the RAF?
     
    Best regards,
    Laurens van der Tang
  • PS-30051345-0 Profile Picture
    69 on at
    Hi @Laurens vd Tang,

    The provided code only posts the journal for the formula. However, in standard behavior, journals are posted for the formula, co-products, and by-products
  • Laurens vd Tang Profile Picture
    4,250 Super User 2026 Season 1 on at
    Good day,
     
    Can you maybe elaborate why this code is needed? Is it for a customization or integration?
     
    Is it not possible to copy the existing code?
     
    Best regards,
    Laurens van der Tang
  • André Arnaud de Calavon Profile Picture
    302,672 Super User 2026 Season 1 on at
    Hi,
     
    Can you show what exact steps you perform when manually performing the RAF? What parameters are provided on the posting job? 

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 221 Super User 2026 Season 1

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 107 Super User 2026 Season 1

#3
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 75

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans