• AX 2012 两种lookup 的显示方式


    第一种:只能单选的lookup:

    代码:

    public void BusinessUnitLookup(FormStringControl    _formstrcontroll)
    {
        //OMOperatingUnit::operatingUnitLookup(_formstrcontroll,OMOperatingUnitType::OMBusinessUnit);
        Query query;
        SysTableLookup sysTableLookup;
        container   con;
    
        delete_from unposttmp;
        unposttmp.clear();
        unposttmp.BusinessUnit   = "ALL";
        unposttmp.insert();
        while select businessunit
            order by Name
        {
            unposttmp.clear();
            unposttmp.BusinessUnit   = businessunit.Name;
            unposttmp.insert();
        }
    
    
        sysTableLookup = SysTableLookup::newParameters(tableNum(GZ_BusinessUnitLookup), _formstrcontroll);
        sysTableLookup.addLookupfield(fieldNum(GZ_BusinessUnitLookup, BusinessUnit));
        sysTableLookup.parmTmpBuffer(unposttmp);
        sysTableLookup.performFormLookup();
    
    }

    第二种,可多选lookup,

    代码:

    public void createdbylookup(FormStringControl   _formstringcontrol)
    {
        Query       query;
        container   con;
        ;
        query = new Query();
        query.addDataSource(tableNum(UserInfo));
        query.dataSourceNo(1).fields().dynamic(NoYes::Yes);
        query.dataSourceNo(1).fields().addField(fieldNum(UserInfo,Id));
        query.dataSourceNo(1).fields().addField(fieldNum(UserInfo,Name));
    
        SysLookupMultiSelectGrid::lookup(query,_formstringcontrol,_formstringcontrol,con);
    
    
    }
  • 相关阅读:
    .Net常用的命名空间
    Jquery测试纠错笔记
    第一章 学习总结
    Java和C++引用的区别
    gin的墙内开发艺术
    golang几个环境变量的问题
    Leetcode240_搜索二维矩阵II
    Leetcode1358_包含所有三种字符的子字符串数目
    Leetcode1354_多次求和构造目标数组
    Leetcode1353_最多可以参加的会议数目
  • 原文地址:https://www.cnblogs.com/Tokywu/p/4763400.html
Copyright © 2020-2023  润新知