Показать сообщение отдельно
Старый 27.04.2021, 10:01   #2  
Ace of Database is offline
Ace of Database
Участник
Аватар для Ace of Database
 
870 / 637 (23) +++++++
Регистрация: 14.10.2004
Заработало
Удалось сделать вот так:
X++:
        purchTable.InventLocationId = 'XXXXXX';
        //purchTable.modifiedField(fieldNum(PurchTable, InventLocationId));
        purchTable.InventSiteId = InventLocation::find(purchTable.InventLocationId).InventSiteId;
        //purchTable.modifiedField(fieldNum(PurchTable, InventSiteId));

            purchTable.update();

            while select forupdate purchLine
                where
                    purchLine.PurchId == purchTable.PurchId
            exists join existInventDim
                where
                    existInventDim.inventDimId == purchLine.InventDimId
                &&  existInventDim.InventLocationId != purchTable.InventLocationId
            {
                inventDim = purchLine.inventDim();
                inventDim.InventLocationId  = purchTable.InventLocationId;
                inventDim.InventSiteId      = inventDim.inventLocation().InventSiteId;
                inventDim = InventDim::findOrCreate(inventDim);
                purchLine.InventDimId = inventDim.inventDimId;
                //purchLine.setInventDimId(inventDim.inventDimId);
                purchLine.update();
            }
После этого утверждение и разноска накладной работают. Вчера почему-то не работало
Теперь все отрабатывает за 10 минут, включая разноску накладной.
__________________
Мои утилиты для Аксапты версий 3.0-2012: http://aceofdatabase.blogspot.com/