Мы пользуем дописанную функцию в классе Global - и для display/edit - методов, и для контролов, передавая в нее расширенный тип и значение
X++:
static void makeJump(int _typeId, Anytype _id)
{
SysDictType dictType;
SysDictRelation typeRelation;
TableId relationTable;
FieldId relationField;
SysDictTable dictTable;
Common record;
str formRef;
FormRun fr;
Args args;
;
dictType = new SysDictType(typeid2extendedTypeId(_typeId));
if(dictType)
{
typeRelation = dictType.relationObject();
relationTable = typeRelation.table();
relationField = typeRelation.lineExternTableValue(1);
if(relationTable != 0)
{
dictTable = new SysDictTable(relationTable);
if(dictTable)
{
formRef = dictTable.formRef();
if(formRef)
{
record = dictTable.makeRecord();
select record where record.(relationField) == _id;
if(record)
{
args = new Args(formRef);
args.record(record);
fr = new FormRun(args);
fr.init();
fr.run();
fr.wait();
}
else
throw error(strfmt('Для таблицы %1 не найдено значение поля %2 равное "%3"', tableid2name(relationTable), fieldid2name(relationTable, relationField), _id));
}
else
throw error(strfmt('Таблица %1 не имеет определенной в АОТ формы отображения', tableid2name(relationTable)));
}
else
throw error(strfmt('У расширенного типа %1 в АОТ указана в качестве связанной несуществующая таблица с кодом %2', dictType.name(), relationTable));
}
else
throw error(strfmt('Расширенный тип %1 не имеет в АОТ указания на связанныую с ним таблицу', dictType.name()));
}
else
throw error(strfmt('В системе отсуствует расширенный тип данных с кодом %1', _typeId));
}