Показать сообщение отдельно
Старый 23.08.2013, 09:59   #7  
ice is offline
ice
Участник
Аватар для ice
Лучший по профессии 2014
 
1,821 / 402 (17) +++++++
Регистрация: 23.03.2006
еще есть нововведение, возврат null вместо пустой не найденной строки, такие места дополняют комментарием
X++:
static EcoResSize resolveProductVariantSize(
    EcoResSizeName     _sizeName,
    RefRecId            _productMaster,
    RefRecId            _productDimensionAttribute)
{
    EcoResSize              ecoResSize;
    EcoResProductMasterSize ecoResProductMasterSize;

    select ecoResSize
        where ecoResSize.Name == _sizeName
    exists join ecoResProductMasterSize
        where ecoResProductMasterSize.Size                          == ecoResSize.RecId
           && ecoResProductMasterSize.SizeProductMaster             == _productMaster
           && ecoResProductMasterSize.SizeProductDimensionAttribute == _productDimensionAttribute;

    if (!ecoResSize.RecId)
    {
        // Assigning null to selectedRecord does not cause the kernel to receive a true NULL value, but rather
        // just an empty record. Return NULL directly so the kernel knows that the intent is to not clear the
        // selected value.
        return null;
    }

    return ecoResSize;
}
За это сообщение автора поблагодарили: S.Kuskov (1).