Перейти к основному содержанию
`Ctrl`+`K`

# Обновление Doc SC

Локальный скрипт модуля MCT. Используется для служебной настройки, миграции, очистки или восстановления данных, связанных с объектами модуля.

Место применения: `Сервис > Инструменты > Выполнить JEXL-скрипт`

Внимание

Скрипт привязан к объектам конкретного модуля и требует проверки на целевой базе. Перед запуском проверьте идентификаторы, SQL-запросы, API-классы и условия обработки.

Тип: JEXL-скрипт

    Btk_Pkg.setRWSharedUOWEditType();
    var idvScShipSpec = Mct_SpecificationApi.idScShipSpec();
    if(idvScShipSpec != null){
    	var idvShipDraftWork = Btk_ObjectTypeApi.findByMnemoCode("ShipDraftWork");
    	if(idvShipDraftWork != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvShipDraftWork), idvScShipSpec);
    	}
    	var idvShipDraft = Btk_ObjectTypeApi.findByMnemoCode("ShipDraft");
    	if(idvShipDraft != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvShipDraft), idvScShipSpec);
    	}
    }
    var idvScMountSpec = Mct_SpecificationApi.idScMountSpec();
    if(idvScMountSpec != null){
    	var idvMountDraftWork = Btk_ObjectTypeApi.findByMnemoCode("MountDraftWork");
    	if(idvMountDraftWork != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvMountDraftWork), idvScMountSpec);
    	}
    	var idvMountDraft = Btk_ObjectTypeApi.findByMnemoCode("MountDraft");
    	if(idvMountDraft != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvMountDraft), idvScMountSpec);
    	}
    }
    var idvScUnitProduct = Mct_SpecificationApi.idScUnitProduct();
    if(idvScUnitProduct != null){
    	var idvUnitProduct = Btk_ObjectTypeApi.findByMnemoCode("UnitProduct");
    	if(idvUnitProduct != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvUnitProduct), idvScUnitProduct);
    	}
    }
    var idvScMatCard = Mct_MatCardApi.idScMatCard();
    if(idvScMatCard != null){
    	var idvmatCard = Btk_ObjectTypeApi.findByMnemoCode("matCard");
    	if(idvmatCard != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvmatCard), idvScMatCard);
    	}
    	var idvMatCardPrj = Btk_ObjectTypeApi.findByMnemoCode("MatCardPrj");
    	if(idvMatCardPrj != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvMatCardPrj), idvScMatCard);
    	}
    	var idvMatCardByTech = Btk_ObjectTypeApi.findByMnemoCode("MatCardByTech");
    	if(idvMatCardByTech != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvMatCardByTech), idvScMatCard);
    	}
    }
    var idvScTechComplectSheet = Mct_TechComplectSheetApi.idScTechComplectSheet();
    if(idvScTechComplectSheet != null){
    	var idvTechComplectSheet = Btk_ObjectTypeApi.findByMnemoCode("TechComplectSheet");
    	if(idvTechComplectSheet != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvTechComplectSheet), idvScTechComplectSheet);
    	}
    }
    var idvScUnitProdSheet = Mct_UnitProdSheetApi.idScUnitProdSheet();
    if(idvScUnitProdSheet != null){
    	var idvUnitProdSheet = Btk_ObjectTypeApi.findByMnemoCode("UnitProdSheet");
    	if(idvUnitProdSheet != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvUnitProdSheet), idvScUnitProdSheet);
    	}
    	var idvUnitProdSheetPrj = Btk_ObjectTypeApi.findByMnemoCode("UnitProdSheetPrj");
    	if(idvUnitProdSheetPrj != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvUnitProdSheetPrj), idvScUnitProdSheet);
    	}
    }
    var idvScPlanLaborDistribution = Mct_PlanLaborDistributionApi.idScPlanLaborDistribution();
    if(idvScPlanLaborDistribution != null){
    	var idvPlanLaborDistribution = Btk_ObjectTypeApi.findByMnemoCode("PlanLaborDistribution");
    	if(idvPlanLaborDistribution != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvPlanLaborDistribution), idvScPlanLaborDistribution);
    	}
    	var idvPlanLaborList = Btk_ObjectTypeApi.findByMnemoCode("PlanLaborList");
    	if(idvPlanLaborList != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvPlanLaborList), idvScPlanLaborDistribution);
    	}
    }
    var idvScTechCompJournalDoc = Mct_TechCompJournalDocApi.idScTechCompJournalDoc();
    if(idvScTechCompJournalDoc != null){
    	var idvTechCompJournalDoc = Btk_ObjectTypeApi.findByMnemoCode("TechCompJournalDoc");
    	if(idvTechCompJournalDoc != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvTechCompJournalDoc), idvScTechCompJournalDoc);
    	}
    }
    //ВЗ материалы
    var idvScMaterial = Mct_OrderSheetApi.idScMaterial();
    if(idvScMaterial != null){
    	var idvOrderSheet = Btk_ObjectTypeApi.findByMnemoCode("OrderSheet");
    	if(idvOrderSheet != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheet), idvScMaterial);
    	}
    	var idvOrderSheetPrj = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetPrj");
    	if(idvOrderSheetPrj != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetPrj), idvScMaterial);
    	}
    	var idvOrderSheetSupply = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetSupply");
    	if(idvOrderSheetSupply != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetSupply), idvScMaterial);
    	}
    	var idvOrderSheetSupplyPrj = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetSupplyPrj");
    	if(idvOrderSheetSupplyPrj != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetSupplyPrj), idvScMaterial);
    	}
    	var idvPreOrderSheet = Btk_ObjectTypeApi.findByMnemoCode("PreOrderSheet");
    	if(idvPreOrderSheet != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvPreOrderSheet), idvScMaterial);
    	}
    	var idvOrderSheetVsp = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetVsp");
    	if(idvOrderSheetVsp != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetVsp), idvScMaterial);
    	}
    	var idvOrderSheetVspPrj = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetVspPrj");
    	if(idvOrderSheetVspPrj != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetVspPrj), idvScMaterial);
    	}
    	var idvOrderSheetTechMat = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetTechMat");
    	if(idvOrderSheetTechMat != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetTechMat), idvScMaterial);
    	}
    }
    //ВЗ оборудование
    var idvScEquip = Mct_OrderSheetApi.idScEquip();
    if(idvScEquip != null){
    	var idvOrderSheetEquip = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetEquip");
    	if(idvOrderSheetEquip != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetEquip), idvScEquip);
    	}
    	var idvOrderSheetEquipPrj = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetEquipPrj");
    	if(idvOrderSheetEquipPrj != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetEquipPrj), idvScEquip);
    	}
    	var idvPreOrderSheetEquip = Btk_ObjectTypeApi.findByMnemoCode("PreOrderSheetEquip");
    	if(idvPreOrderSheetEquip != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvPreOrderSheetEquip), idvScEquip);
    	}
    	var idvOrderSheetZip = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetZip");
    	if(idvOrderSheetZip != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetZip), idvScEquip);
    	}
    	var idvOrderSheetZipPrj = Btk_ObjectTypeApi.findByMnemoCode("OrderSheetZipPrj");
    	if(idvOrderSheetZipPrj != null){
    		Btk_ObjectTypeApi.setidSubClass(Btk_ObjectTypeApi.load(idvOrderSheetZipPrj), idvScEquip);
    	}
    }

    commit();