How to make invisible the lookup field?

2019-08-17 01:21发布

I want to take a value from lookup field. But I neet to make invisible this field. My code is this:

public void lookup()
{    
    Query query = new Query();
    QueryBuildDataSource queryBuildDataSource;
    QueryBuildRange queryBuildRange;    
    SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(MYTable), this);    
    sysTableLookup.addLookupField(fieldNum(MYTable, FieldTableA));
    sysTableLookup.addLookupField(fieldNum(MYTable, FieldTableB));
    sysTableLookup.addLookupField(fieldNum(MYTable, RecId), true);    
    queryBuildDataSource = query.addDataSource(tableNum(MYTable));    
    sysTableLookup.parmQuery(query);    
    sysTableLookup.performFormLookup();
}

So, I need to populate the field with RecID, but I don't want to see the RecId in my lookup.

It's possible?

Or, another question, It's possible to get two value for the same record, in my case to get the values from MyTable.FieldTableA and Mytable.FieldTableB?

2条回答
做自己的国王
2楼-- · 2019-08-17 01:33

After re-reading your question, what you want to do is common and base functionality.

It's called using Referenced Data Sources. See below:

https://msdn.microsoft.com/en-us/library/gg845085.aspx

You can look how addresses (LogisticsPostalAddress) are stored on objects, such as SalesTable to see.

查看更多
smile是对你的礼貌
3楼-- · 2019-08-17 01:34

No this is not possible with the standard lookup as far as I can tell. You can see how it builds the dynamic lookup form here:

\Classes\SysTableLookupBase\buildGrid

You can make your own custom lookup form.

查看更多
登录 后发表回答