• D365 覆写标准逻辑


    以生产订单更新为已开始为例子说明如何覆写标准的功能

    1,对Class:ProdUpdRelease的声明实例方法construct创建post事件

    class VYA_ProdUpdReleaseEventHandler
    {
    }
    public static void constructPostHandler(XppPrePostArgs _args)
    {
        ProdUpdRelease  prodUpdRelease;
        ;
    
        prodUpdRelease  = _args.getReturnValue();
        prodUpdRelease = new VYA_ProdUpdReleaseExtension();
    
        _args.setReturnValue(prodUpdRelease);
    }

    2,创建Class: VYA_ProdUpdReleaseExtension继承ProdUpdRelease

    public class VYA_ProdUpdReleaseExtension extends ProdUpdRelease
    {
    }

    3,添加需要覆写的方法

    void updateProdBOM()
    {
        ProdBOM  prodBOM;
        while select forupdate prodBOM
            where prodBOM.ProdId == prodParmRelease.ProdId
        {
            if (prodBOM.Reservation == ProdReservation::Release)
            {
                InventMovement::construct(prodBOM).updateReservation();
            }
            // 添加客制化的逻辑代码
            /*
            info("test");
            */
            if (prodBOM.mandatoryWMSOrder())
            {
                prodBOM.createWMSOrder();
            }
        }
    }
  • 相关阅读:
    Kth Smallest Element in a BST
    Bitwise AND of Numbers Range
    Happy Number
    Summary Ranges
    linux设置MySQL开机自动启动
    基本PSO算法实现(Java)
    Invert Binary Tree
    Rectangle Area
    Contains Duplicate II
    Contains Duplicate
  • 原文地址:https://www.cnblogs.com/dingkui/p/14466782.html
Copyright © 2020-2023  润新知