Friday, February 18, 2022

OnValidated Event Handler

   [FormControlEventHandler(formControlStr(SalesTable, InventoryDimensionsGrid_inventBatchId), FormControlEventType::Validated)]

    public static void InventoryDimensionsGrid_inventBatchId_OnValidated(FormControl sender, FormControlEventArgs e)

    {

        SalesLine salesLine;

        InventDim inventDim;

        boolean ret;


        FormControlCancelEventArgs args = e as FormControlCancelEventArgs;


        FormRun formRun = sender.formRun();


        FormStringControl batchId = formRun.design(0).controlName("ControlName");

        InventBatchId inventBatchId = batchId.text();


        select firstonly RecId from salesLine

           join inventDim where inventDim.inventDimId == salesLine.InventDimId

            &&  inventDim.inventBatchId == inventBatchId && inventDim.inventBatchId !=''

            && salesLine.ProductionOrderReference !="";


        if(salesLine.RecId)

        {

ret = checkFailed("BatchAllocationError");

args.cancel(true);

        }

    }

No comments:

Post a Comment

Sample Dialog Syntax - 1

 class AffiliationAutoAssignment extends RunBaseBatch {     // 1. Class Declaration and Pack variables     #define.CurrentVersion(1)     #de...