Here is the sample code to pass / store values between pre and post event handlers using args. You can set the value in pre-event handler using args.addArg and get the value in post handler args.getArg.
/// <summary>
///
enforcePayRateTolerance pre event handler
///
</summary>
///
<param name="args">Event args</param>
[PreHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable,
enforcePayRateTolerance))]
public static void
HRMCompFixedPlanTable_Pre_enforcePayRateTolerance(XppPrePostArgs args)
{
HRMCompFixedPlanTable HRMCompFixedPlanTable
= args.getThis();
args.addArg("Tolerance", HRMCompFixedPlanTable.Tolerance);
HRMCompFixedPlanTable.Tolerance = HRMCompTolerance::None;
}
///
<summary>
///
enforcePayRateTolerance post event handler
///
</summary>
///
<param name="args">Event args</param>
[PostHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable,
enforcePayRateTolerance))]
public static void
HRMCompFixedPlanTable_Post_enforcePayRateTolerance(XppPrePostArgs args)
{
HRMCompFixedPlanTable HRMCompFixedPlanTable
= args.getThis();
HRMCompTolerance tolerance;
if (args.existsArg("Tolerance"))
{
tolerance = args.getArg("Tolerance");
HRMCompFixedPlanTable.Tolerance =
tolerance;
}
}
No comments:
Post a Comment