Production Orders are cleaned up / deleted - Song Nghia - Microsoft Dynamics Partner

Song Nghia - Microsoft Dynamics Partner

Song Nghia - Microsoft Dynamics Partner

Breaking

Friday, January 22, 2021

Production Orders are cleaned up / deleted

 Production Orders are cleaned up / deleted

Nghia Song -  Microsoft Dynamics 365 Technical Consultant

Nghia Song

Tel - WhatsApp: +84967324794

Email: songnghia.uit@gmail.com

This will get the job done but needs more testing. After Production Orders are cleaned up / deleted, this will clean up the ProdParm* related tables.

static void Job39(Args _args)
{
ProdParmBOMCalc prodParmBomCalc;
ProdParmCostEstimation ProdParmCostEstimation;
ProdParmHistoricalCost ProdParmHistoricalCost;
ProdParmRelease ProdParmRelease;
ProdParmReportFinished ProdParmReportFinished;
ProdParmScheduling ProdParmScheduling;
ProdParmSplit ProdParmSplit;
ProdParmStartUp ProdParmStartUp;
ProdParmStatusDecrease ProdParmStatusDecrease;
ProdParmUpdate ProdParmUpdate;
ProdTable prodTable;

delete_from prodParmBomCalc
notexists join ProdTable
where prodTable.ProdId == prodParmBomCalc.ProdId;

delete_from ProdParmCostEstimation
notexists join ProdTable
where prodTable.ProdId == ProdParmCostEstimation.ProdId;

delete_from ProdParmHistoricalCost
notexists join ProdTable
where prodTable.ProdId == ProdParmHistoricalCost.ProdId;

delete_from ProdParmRelease
notexists join ProdTable
where prodTable.ProdId == ProdParmRelease.ProdId;

delete_from ProdParmReportFinished
notexists join ProdTable
where prodTable.ProdId == ProdParmReportFinished.ProdId;

delete_from ProdParmScheduling
notexists join ProdTable
where prodTable.ProdId == ProdParmScheduling.ProdId;

delete_from ProdParmSplit
notexists join ProdTable
where prodTable.ProdId == ProdParmSplit.ProdId;

delete_from ProdParmStartUp
notexists join ProdTable
where prodTable.ProdId == ProdParmStartUp.ProdId;

delete_from ProdParmStatusDecrease
notexists join ProdTable
where prodTable.ProdId == ProdParmStatusDecrease.ProdId;

}

No comments:

Post a Comment