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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...