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);
}
}
Welcome to the future! Financing made easy with Prof. Mrs. DOROTHY LOAN INVESTMENTS
ReplyDeleteHello, Have you been looking for financing options for your new business plans, Are you seeking for a loan to expand your existing business, Do you find yourself in a bit of trouble with unpaid bills and you don’t know which way to go or where to turn to? Have you been turned down by your banks? MRS. DOROTHY JEAN INVESTMENTS says YES when your banks say NO. Contact us as we offer financial services at a low and affordable interest rate of 2% for long and short term loans. Interested applicants should contact us for further loan acquisition procedures via profdorothyinvestments@gmail.com
I'm here to share an amazing life changing opportunity with you. its called Bitcoin / Forex trading options, Are you interested in earning a consistent income through binary/forex trade? or crypto currency trading. An investment of $200 can get you a return of $2,480 in 7 days of trading, We invest in all profitable projects with cryptocurrencies. We have excellent trading instruments and also support them with the best tools. Make as much as $1,000 or more every week with a starting capital of $200 to $350 You earn 100% of your initial profit every 7-14 business days and you get to do this from the comfort of your home/work. The truth is you must make profits trading in Cryptocurrency and investing in good signals with the best guidance from Crypto Coins Trading. Start investing with Crypto Coins Trading and start earning profitable interest quick without no doubt Payout weekly 100% guaranteed profit without any Hassles, It goes on and on The higher the investment, the higher the profits. Your investment is safe and secured and payouts assured 100%. if you wish to know more about investing in Cryptocurrency and earn daily, weekly OR Monthly in trading on bitcoin or any cryptocurrency and want a successful trade without losing Contact MRS.DOROTHY JEAN INVESTMENTS profdorothyinvestments@gmail.com
categories of investment
Cryptocurrency
Loan Offer
Mining Plan
Business Finance Plan
Binary option Trade Plan
Forex trade Plan
Stocks market Trade Plan
Return on investment (ROI) Plan
Gold and Silver Trade Plan
Oil and Gas Trade Plan
Diamond Trade Plan
Agriculture Trade Plan
Real Estate Trade Plan
YOURS IN SERVICE
Mrs. Dorothy Pilkenton Jean
Financial Advisor on Bank Instruments,
Private Banking and Client Services
Email Address: profdorothyinvestments@gmail.com
Operation: We provide Financial Service Such As Bank Instrument
From AA Rate Banks, Cash Loan,BG,SBLC,BOND,PPP,MTN,TRADING,FUNDING MONETIZING etc.