Creating a verification on endjob in productionfinish

Hello, I need help with my task. I need to verify if all products in BOM are ready to report as finished.

The solution that im thinking is to verify if all sub tasks of the main task are marked.

So I need enable or disable the endjob on the statement result.

Im all new in this so I appreciate all help.

Actually im trying to disable edit value on this field if condition is false.

public class ProdParmReportFinishedVerify

   ProdParmReportFinished ProdParmReportFinished;
   ProdTable ProdTable;

   public void run()

        {while select ProdId, ProdStatus, InventRefType, InventRefID from ProdTable where  
            InventRefType::CRMQuotation && InventRefType::FixedAsset && InventRefType::InventJournal
             && InventRefType::InventTransfer && InventRefType::ProdLine && InventRefType::Production
             && InventRefType::Purch && InventRefType::Sales 
            ProdParmReportFinished.EndJob = NoYes::Yes;
          info(' Success');
                ProdParmReportFinished.EndJob = NoYes::No;
                info(' Failed verification');