• [AX]AX2012 R2 EP员工自助服务订单中的产品


    研究这个问题是因为EP站点的员工服务Order product只看到产品目录而没有看到具体的产品,点击任何一个产品子目录都是空的。

    首先考虑的第一个问题是这些目录子目录都是从哪里来的?搞清楚这个问题并不简单,从页面ASPX Webpart开始,查找到它是由CatDisplayCategoryLeftNavigation web控件显示的,web控件包含一个aspx的Tree控件,数据源来自于AX的CatParentDisplayCategories数据集,数据集中最主要的数据表是CatDisplayCategoryTable,它记录了所有产品的组织目录。产品目录在Procurement and sourcing/Common/Catalogs/Procurement catalogs窗口维护,列表中看到的是集团内所有的产品目录列表(表CatDisplayCategoryTable是不记录公司的),打开一个目录就能看到目录具体的树形结构,也是出现在员工服务订购产品页面上的产品目录结构。每个目录有一个根节点,其下包含子节点,每个目录节点可以是动态(根据规则动态添加产品),也可以静态,或者两者皆是,无论哪种方式,都可以手工添加产品和供应商到目录节点下。

    在Procurement catalogs列表中我们看到多个产品目录,那么针对一个具体的员工该具体显示哪个产品目录呢?这是第二个问题。在数据集CatParentDisplayCategories的filter方法中我们能找到答案,最重要的方法是CatProcurementCache::getLandingDisplayCategoryForUser(),由它查找当前用户的产品目录,实际上这个方法非常复杂,首先它根据组织架构信息收集用户对应的员工信息、部门信息,注意用户和员工不是一回事,需要在System administration/Common/Users/Relations指定一个员工到用户,另外用户的Profle决定打开EP的默认页,如果设置用户Profile为Employee则会默认打开员工服务站点首页。有了员工信息及其部门信息,使用CatCatalogPolicyRule::findCatalogByPolicy(_employerRecId, _departmentRecId)从采购策略的Catalog policy rule( Procurement and sourcing > Setup > Policies > Purchasing policies)配置获取相关的产品根目录记录,这样就确定了员工服务产品目录树。

    我们还需要一个步骤才能在点击产品目录时看到具体的产品:Procurement and sourcing>Periodic>Employee service>Synchornize product search data,它将数据从CatProductFilter表添加到CatProductFilterMaterialized表;从CatProductSearchableAttributeFilter添加到CatProdSerchableAttrFilterMaterialized,AOT中看不到表CatProductFilter和CatProductSearchableAttributeFilter,表CatProductFilterMaterialized和CatProductSearchableAttributeFilter虽然能在AOT中看到但却是看不到表数据(属性visible=no),在SQL数据库表中我们能看到这些表记录的是产品recid对应的目录recid以及相关的Partition等信息。

    AX中还有一个Product categories(Product information management/Setup/Categories/Category hierarchies),也是用树形结构来分录组织产品,用于产品及其交易的分析等,和我们这里讲的Catalog不是一回事,我们在创建Catalog的时候可以用Procurement category的数据来填充Catalog(选中Populate catalog using procurement category hierarchy)。

  • 相关阅读:
    打开Intellij Idea 2020.1 提示 cannot load a jdk class: com.sun.jdi.Field
    win10触摸板设置为连接鼠标不打开后就自动关闭
    git配置账号
    HTTP请求中的Form Data与Request Payload的区别
    VUE—axios自定义请求配置—3、transformRequest在向服务器发送前,修改请求数据(图文详情)
    在Sass中,我们可以使用“@for”来实现循环操作
    vue项目引入背景图报Module not found: Error: Can't resolve './src/assets/theme/logo_blue.png' in'xxx'错误
    Importing code style from ESLint
    ESLint fix自动修复所有格式问题
    【T07】不要低估tcp的性能
  • 原文地址:https://www.cnblogs.com/duanshuiliu/p/3117372.html
Copyright © 2020-2023  润新知