ProdRouteOverlapCalc.validate Method [AX 2012]

Validates whether the data is correct and that the calculation can be done in the correct way.

public boolean validate()

Run On

Called

Return Value

Type: boolean
true if the calculation data is correct; otherwise, false.

You must use this method before the calculation is run.

static void calculateOverlap(ProdRoute _prodRoute) 
{ 
    ProdRouteOverlapCalc prodRouteOverlapCalc; 
    RouteOprQtyOverlap overlapValue; 
 
    if(!_prodRoute.RecId) 
    { 
        throw error("@SYS19457"); 
    } 
    prodRouteOverlapCalc =  
        prodRouteOverlapCalc::newProdRoute(_prodRoute, false, false); 
     
    // Validate calculation data. 
    prodRouteOverlapCalc.validate(); 
     
    // Calculate overlap value. 
    overlapValue = prodRouteOverlapCalc.calcOverlap(); 
    
    // Show the result. 
    info(strfmt("The calculated overlap is %1", overlapValue)); 
}

Community Additions

ADD
Show: