AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 02.08.2018, 18:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
d365technext: Environment Hot-Fixes List Using X++ D365FO & AX 7
Источник: http://d365technext.blogspot.com/201...t-using-x.html
==============


Environment Hot-Fixes List Using X++ D365FO & AX 7


We All knows that information about metadata hotfixes installed directly from Visual Studio and we can check them Using Apply Hotfix Addins(Dynamics 365 -> Addins -> Apply Hotfix).










The same things we can retrieve using X++ Job

Result





Code Sample


class SLD_DemoClass
{


public static void main(Args _args)
{
new SLD_DemoClass().processExecution();


}


public void processExecution()
{
var environment = Microsoft.Dynamics.ApplicationPlatform.Environment.EnvironmentFactory::GetApplicationEnvironment();


Microsoft.Dynamics.AX.Metadata.Providers.IMetadataProvider metadataProvider =
this.getDiskMetadataProvider(environment);




Microsoft.Dynamics.AX.Metadata.Providers.IMetaUpdateProvider updateProvider = metadataProvider.get_Updates();


var moduleInfoList = metadataProvider.ModelManifest.ListModules();
var i = moduleInfoList.GetEnumerator();


setPrefix('Installed KBs on your Instance');


while (i.MoveNext())
{
Microsoft.Dynamics.AX.Metadata.MetaModel.IModuleInfo moduleInfo = i.get_Current();
System.String moduleName = moduleInfo.get_Name();


setPrefix(moduleName);


var updatesHotfixesEnumerator = updateProvider.ListObjects(moduleName).GetEnumerator();;
while (updatesHotfixesEnumerator.moveNext())
{
System.String axUpdateName = updatesHotfixesEnumerator.get_Current();
Microsoft.Dynamics.AX.Metadata.MetaModel.AxUpdate axUpdateObject = updateProvider.Read(axUpdateName);


utcdatetime installedDateTime = axUpdateObject.get_AppliedDateTime();
setPrefix(strFmt('Name %1, Installed on %2', axUpdateObject.get_Name(), installedDateTime));
var listKb = axUpdateObject.get_KBNumbers().GetEnumerator();
while (listKb.MoveNext())
{
info(listKb.get_Current());
}
}
}
}


public Microsoft.Dynamics.AX.Metadata.Providers.IMetadataProvidergetDiskMetadataProvider(Microsoft.Dynamics.ApplicationPlatform.Environment.IApplicationEnvironment _Instance)
{
Microsoft.Dynamics.AX.Metadata.Storage.DiskProvider.DiskProviderConfigurationdiskProviderConfiguration = new Microsoft.Dynamics.AX.Metadata.Storage.DiskProvider.DiskProviderConfiguration();


diskProviderConfiguration.AddMetadataPath(_Instance.get_Aos().get_PackageDirectory());


Microsoft.Dynamics.AX.Metadata.Storage.MetadataProviderFactorymetadataProvicerFactory = new Microsoft.Dynamics.AX.Metadata.Storage.MetadataProviderFactory();


returnmetadataProvicerFactory.CreateDiskProvider(diskProviderConfiguration);
}




}







Источник: http://d365technext.blogspot.com/201...t-using-x.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stephenmann: Technical History of Dynamics AX - From Axapta 3.0 to AX2012 Blog bot DAX Blogs 5 03.03.2017 10:22
atinkerersnotebook: Self Service Reporting for Dynamics AX Users – Part 3: Adding Additional Fields to List Page Views Blog bot DAX Blogs 0 07.10.2015 18:11
dynamics-ax: Open AX & PTC FlexPLM Positions! Blog bot DAX Blogs 0 02.12.2010 00:11
jinx: Dynamics AX AIF Webservices – Date, Time und Datetime Datentypen Blog bot DAX auf Deutsch 0 12.06.2010 01:05
Arijit Basu: AX 2009 - Quick Overview Blog bot DAX Blogs 4 19.05.2008 14:47

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 01:14.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.