Показать сообщение отдельно
Старый 01.10.2010, 13:06   #9  
titov is offline
titov
Участник
 
73 / 87 (3) ++++
Регистрация: 23.12.2005
Адрес: Казань
Цитата:
Сообщение от 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_WbeforeInit));
    
// </GEEU>
    
super();
    
SysSecurityFormSetup::loadSecurity(this);
    
this.dimensionFieldCtrls();
    
this.inventStorageDimFieldCtrls();
    if (
this.isWorkflowEnabled())
    {
        
workflowControls SysWorkflowFormControls::construct(this);
        
workflowControls.initControls();
    }
    
// <GEEU>
    
this.raiseEvent_W(methodstr(FormRunListener_WafterInit));
    
// </GEEU>
    
this.initGuidLookupFieldValue();// <==

позиционирование работает и при лукапе и при переходе
минусы
1. сортировка по recid - но не вижу разницы между guid или recid сортировкой.
2. да, затронут стандартный класс.
За это сообщение автора поблагодарили: gl00mie (3), player (1).