zoukankan      html  css  js  c++  java
  • AX2009根据当前显示维度查询

    在上一篇中已经获取到了当前窗体的维度显示,那如何根据获取到的维度显示进行其他的查询呢?

    系统给出了两种方案

    方案1

    使用宏#InventDimJoin

    调用参数在行1到行5已经给出了,按照这几个参数调用就可以了

     1 /* %1 InventDimId           */
     2 /* %2 InventDim             */
     3 /* %3 InventDimCriteria     */
     4 /* %4 InventDimParm         */
     5 /* %5 Index hint            */
     6 
     7 join tableId from %2
     8     #ifnot.empty(%5)
     9         index hint %5
    10     #endif
    11     
    12     where (%2.InventDimId       == %1) &&
    13           (%2.ConfigId          == %3.ConfigId              || ! %4.ConfigIdFlag)           &&
    14           (%2.InventSizeId      == %3.InventSizeId          || ! %4.InventSizeIdFlag)       &&
    15           (%2.InventColorId     == %3.InventColorId         || ! %4.InventColorIdFlag)      &&
    16           (%2.InventSiteId      == %3.InventSiteId          || ! %4.InventSiteIdFlag)       &&
    17           (%2.InventLocationId  == %3.InventLocationId      || ! %4.InventLocationIdFlag)   &&
    18           (%2.InventBatchId     == %3.InventBatchId         || ! %4.InventBatchIdFlag)      &&
    19           (%2.WMSLocationId     == %3.WMSLocationId         || ! %4.WMSLocationIdFlag)      &&
    20           (%2.WMSPalletId       == %3.WMSPalletId           || ! %4.WMSPalletIdFlag)        &&
    21           (%2.InventSerialId    == %3.InventSerialId        || ! %4.InventSerialIdFlag)22 #InventDimDevelop

    原理和简单,就是根据表InventDimParm中的字段显示标识,做为查询的条件进行关联,但是这种方法只能使用在查询语句中

    那就介绍另一种方案,可以用在Query中的

    方案2

    使用动态组合查询

     1     InventDimParm                   inventDimParm=callerArgs.caller().parmDimParmVisibleGrid();//获取显示的维度
     2     container                       dimFields = InventDim::dimFieldList();//获取当前系统使用的维度
     3     QueryBuildDataSource            inventDimqbs=this.query().dataSourceTable(tablenum(InventDim));//关联当前Form的Dim数据源
    5 FormDataSource                  inventDimFrqbs=InventDim::callerInventDimDatasource(callerArgs);//从调用Form获取Dim数据
    6
    int h; 7 fieldId dimParmFieldId,dimFieldId; 8 ; 9 for(h=1;h<=conlen(dimFields);h++) 10 { 11 dimFieldId = conpeek(dimfields,h);//维度ID 12 dimParmFieldId = InventDim::dim2dimParm(dimFieldId);//显示维度ID 13 if(inventDimParm.(dimParmFieldId)) 14 inventDimqbs.addRange(dimFieldId).value(queryValue(inventDimFrqbs.cursor().(dimFieldId)));//根据显示的维度进行过滤 15 else 16 inventDimqbs.addRange(dimFieldId).value(SysQuery::valueUnlimited());//不显示的维度取消过滤 17 }
  • 相关阅读:
    分布式任务调度平台XXL-JOB
    在线文档分享工具 ShowDoc
    SVN 资源权限管理系统 SVNAdmin
    JFinal Weixin 微信极速 SDK
    Mybatis 增强工具包 Mybatis-Plus
    认识与入门:Markdown
    【Github】如何删除github上的项目
    【IntelliJ 】IntelliJ IDEA 自动导入包 快捷方式 关闭重复代码提示
    【Eclipse+IntelliJ反编译】Eclipse/IntelliJ IDEA反编译查看源码及注释
    【Eclipse】eclipse安装JAVA反编译插件
  • 原文地址:https://www.cnblogs.com/rumenren/p/3177227.html
Copyright © 2011-2022 走看看