D365 Finance & Operations and Dynamics AX Forum

Expand all | Collapse all

X++ PreHandlerFor WHSShipConfirm

  • 1.  X++ PreHandlerFor WHSShipConfirm

    Posted Feb 07, 2020 11:00 AM
    Hello,

    I am trying to access the record value; but have been unsuccessful. Does anyone have a code snippet of how to drill into this value? The result would go into the WHSLoadTable object. I've tried to access using FormRun and getThis(); which returns null. Thanks.



    ------------------------------
    Bill Negley
    Utz Quality Foods
    ------------------------------
    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: X++ PreHandlerFor WHSShipConfirm

    MICROSOFT MVP
    Posted Feb 10, 2020 05:28 AM
    Hi Bill,

    Can you explain functional what you want to achieve?

    ------------------------------
    kind regards,

    André Arnaud de Calavon
    Product manager, Microsoft MVP - Microsoft Dynamics Business Solutions
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 3.  RE: X++ PreHandlerFor WHSShipConfirm

    Posted Feb 10, 2020 07:53 AM
    I am tasks to add some functionality prior to the confirmation occurring. I worked with a colleague and we got this to work.

      [PreHandlerFor(classStr(WHSShipConfirm), staticMethodStr(WHSShipConfirm, main))]
    public static void WHSShipConfirm_Pre_main(XppPrePostArgs args)
    {


    wHSLoadTable WHSLoadTable;

    Args _args = args.getArg("_args");

    if (_args.record().TableId == TableNum(WHSLoadTable))
    {
    WHSLoadTable = _args.record();
    }

    }

    Now that i have access to the WHSLoadTable fields, i can do my pre-confirmation steps.

    ------------------------------
    Bill Negley
    Utz Quality Foods
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role