Цитата:
Сообщение от
Poleax
С переходом к основной таблице тоже типа такой баг? Как нибудь решается, без насильственного программирования?
что подразумевается под "насильственного программирования"?
есть такой вариант - немного подправить класс SysSetupFormRun
X++:
void initGuidLookupFieldValue()
{
Common record;
SysDictTable dt;
guid guidLookupValue;
;
if( !this.args()
|| !this.args().lookupField()
|| !this.args().lookupValue()
|| !this.dataSourceCount()
)
return;
dt = new SysDictTable(this.dataSource(1).cursor().TableId);
if(dt.fieldObject(this.args().lookupField()).baseType() != types::Guid)
return;
if(!dt.hasRecidIdx()) //?!
return;
guidLookupValue = str2guid(this.args().lookupValue());
record = dt.makeRecord();
select firstonly recid from record
where record.(this.args().lookupField()) == guidLookupValue;
if(!record.RecId)
return;
this.args().lookupField(dt.fieldName2Id(identifierStr(recid)) );
this.args().lookupValue(int642str(record.RecId));
}
PHP код:
public void init()
{
// <GEEU>
this.raiseEvent_W(methodstr(FormRunListener_W, beforeInit));
// </GEEU>
super();
SysSecurityFormSetup::loadSecurity(this);
this.dimensionFieldCtrls();
this.inventStorageDimFieldCtrls();
if (this.isWorkflowEnabled())
{
workflowControls = SysWorkflowFormControls::construct(this);
workflowControls.initControls();
}
// <GEEU>
this.raiseEvent_W(methodstr(FormRunListener_W, afterInit));
// </GEEU>
this.initGuidLookupFieldValue();// <==
}
позиционирование работает и при лукапе и при переходе
минусы
1. сортировка по recid - но не вижу разницы между guid или recid сортировкой.
2. да, затронут стандартный класс.