Showing posts with label Passing values between PreHandler & PostHandler. Show all posts
Showing posts with label Passing values between PreHandler & PostHandler. Show all posts

Passing values between PreHandler & PostHandler



Passing values between PreHandler & PostHandler 


using the below code you can pass the custom value between pre handler and post handler


Example


  /// <summary>
    /// enforcePayRateTolerance pre event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PreHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable, enforcePayRateTolerance))]
    public static void HRMCompFixedPlanTable_Pre_enforcePayRateTolerance(XppPrePostArgs args)
    {
   

        args.addArg("Tolerance", "Sheikh Sohail Hussain");

    }







 Example
    /// <summary>
    /// enforcePayRateTolerance post event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PostHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable, enforcePayRateTolerance))]
    public static void HRMCompFixedPlanTable_Post_enforcePayRateTolerance(XppPrePostArgs args)
    {
      

        if (args.existsArg("Tolerance"))
        {
           Info( args.getArg("Tolerance"))

     
        }
    }

Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...