AXForum  
Zurück   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Kennwort vergessen?
Registrieren Forum Rules Hilfe Benutzerliste Heutige Beiträge Suchen

 
 
Themen-Optionen Thema durchsuchen Ansicht
Alt 09.09.2021, 04:51   #1  
Blog bot ist offline
Blog bot
Участник
 
25.646 / 848 (80) +++++++
Registriert seit: 28.10.2006
d365technext: Environment Hot-Fixes List Using D365FO
Источник: https://d365technext.blogspot.com/20...OHotfixes.html
==============






Environment Hot-Fixes List Using X++ D365FO







We All know that information about metadata hotfixes is 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

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.IMetadataProvider getDiskMetadataProvider(Microsoft.Dynamics.ApplicationPlatform.Environment.IApplicationEnvironment _Instance)

{

Microsoft.Dynamics.AX.Metadata.Storage.DiskProvider.DiskProviderConfiguration diskProviderConfiguration = new Microsoft.Dynamics.AX.Metadata.Storage.DiskProvider.DiskProviderConfiguration();

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

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




return metadataProvicerFactory.CreateDiskProvider(diskProviderConfiguration);

}

}















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

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
d365technext: List of Tables X++ D365FO, AX7 and AX2012 Blog bot DAX Blogs 0 10.09.2018 18:11
d365technext: Environment hot fixes D365FO Blog bot DAX Blogs 0 16.08.2018 14:11
d365technext: Environment Hot-Fixes List Using X++ D365FO & AX 7 Blog bot DAX Blogs 0 02.08.2018 18:12
yetanotherdynamicsaxblog: List hotfixes using PowerShell in D365FO (AX7) Blog bot DAX Blogs 0 13.01.2018 20:21
Microsoft Dynamics CRM Team Blog: Marketing with Dynamic List Blog bot Dynamics CRM: Blogs 0 09.11.2010 19:05

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Gehe zu

Рейтинг@Mail.ru
Alle Zeitangaben in WEZ +3. Es ist jetzt 21:03 Uhr.
Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.