Мы сделали так. Скорость разноски увеличилась на порядок.
1. Обявляем в классе \Classes\Application.classDeclaration переменную
X++:
Map mappingsInfo_RU; // Оптимизация разноски накладной, EVO 26.04.2011
2. Добавляем новый метод \Classes\Application\mappingsInfo_RU
X++:
// Оптимизация разноски накладной, EVO 26.04.2011
Map mappingsInfo_RU()
{
;
if (!mappingsInfo_RU)
{
mappingsInfo_RU = new Map(Types::Container, Types::Class); // [TableId, MapId], MappingsInfo_RU object
}
return mappingsInfo_RU;
}
3. Модификацируем метод \Classes\MappingsInfo_RU\createMapWithFieldId
X++:
static public Map createMapWithFieldId(tableId _tableId, tableId _mapID)
{
MappingsInfo_RU mappingsInfo;
;
// Оптимизация разноски накладной, EVO 26.04.2011 -->
//orig mappingsInfo = new MappingsInfo_RU(_tableId, _mapID);
//orig return mappingsInfo.find();
if (!appl.mappingsInfo_RU().exists([_tableId, _mapID]))
{
mappingsInfo = new MappingsInfo_RU(_tableId, _mapID);
appl.mappingsInfo_RU().insert([_tableId, _mapID], mappingsInfo.find());
}
return appl.mappingsInfo_RU().lookup([_tableId, _mapID]);
// Оптимизация разноски накладной, EVO 26.04.2011 <--
}