Tuesday, October 16, 2018

Passing values between PreHandler & PostHandler method in Dynamics 365 FO


    /// <summary>
    /// method -getNum - pre event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PreHandlerFor(tableStr(DevCustomTable),tableMethodStr(DevCustomTable, getNum))]
    public static void DevCustomTable_Pre_getNum(XppPrePostArgs args)
    {
        args.addArg("parmPreArgs""Value 1234567890");
    }

    /// <summary>
    /// method - getNum- Post event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PostHandlerFor(tableStr(DevCustomTable),tableMethodStr(DevCustomTable, getNum))]
    public static void DevCustomTable_Post_ getNum (XppPrePostArgs args)
    {
        if (args.existsArg("parmPreArgs"))
        {
           Info(args.getArg("parmPreArgs"));
        }
    }

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...