display-метод в Lookup-е
интересен код (автор PMS):
X++:
class AdvWebTableLookup
{
static dictType methodReturnDictType(TableId _tableId, identifiername _methodName)
{
DictTable dictTable;
DictMethod dictMethod;
DictType dictType;
int i;
;
dictTable = new DictTable(_tableId);
for(i=1; i <= dictTable.objectMethodCnt(); i++)
{
dictMethod = dictTable.objectMethodObject(i);
if(dictMethod.name() == _methodName)
{
if(dictMethod &&
(dictMethod.displayType() == DisplayFunctionType::Get ||
dictMethod.displayType() == DisplayFunctionType::Set) &&
dictMethod.returnType() != Types::CONTAINER)
{
dictType = new DictType(dictMethod.returnId());
if(dictType)
{
break;
}
else
{
warning(strFmt('Display/Editmethod do not use an extendedtype as return type: %1',fieldId2pName(dictTable.id(),-i)));
}
}
}
}
return dictType;
}
// используем:
// AdvWebTableLookup::methodReturnDictType(_tableId, _method).label();
}