How to stop Workflow from submitting on certain conditions

 How to stop Workflow from submitting on certain conditions

class AccptQtyWFValidation

{

   

    // /// <summary>

    /////

    ///// </summary>

    ///// <param name="args"></param>

    [PostHandlerFor(classStr(SLD_InventQualityOrderTable_Extension), methodStr(SLD_InventQualityOrderTable_Extension, canSubmitToWorkflow))]

    public static void SLD_InventQualityOrderTable_Extension_Post_canSubmitToWorkflow(XppPrePostArgs args)

    {

        boolean     ret;

        InventQualityOrderTable  table;


        ret     = args.getReturnValue();

        table   = args.getThis();


        if(table.IsAcceptedQty == 0 && table.AcceptedQuantity == 0)

        {

            ret = ret && checkFailed(" First Check 'IS Accepted Quntity Zero'.");

        }

        

        args.setReturnValue(ret);

    }


}

Comments

Popular posts from this blog

D365FO – AX – X++ –Refresh, Reread, Research, and ExecuteQuery

Create Inventory Journal through Code in D365FO X++

SalesLine Reservation in D365fo x++