How to make invisible the lookup field?

耗尽温柔 提交于 2020-01-07 03:08:20

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/34077678/how-to-make-invisible-the-lookup-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!