What Is Microsoft Dynamics AX and D365FO?

 

Dynamics AX & Dynamics 365 Finance & Operations


Microsoft Dynamics AX is a powerful ERP solution that helps global enterprises organize, automate, and optimize their processes. Microsoft Dynamics AX is simple and intuitive to use and is quick to prove ROI after implementation. Now integrated with the Dynamics 365 product suite, this software tackles alongside other Microsoft software to create a comprehensive, sophisticated ERP.

Dynamics AX helps you take full advantage of new business opportunities across the globe through centralized financial management intelligence and embedded analytics. It also provides country-specific localizations in a single solution, helping your business meet regulations for dozens of countries, including high-growth markets such as Brazil, India, China, and Russia.

Support Faryal's Cusine


Environment Hot-Fixes List Using D365FO

 


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);

        }

}





Support Faryal's Cusine


Multi-thread Imports in Dynamics 365 for Finance & Operations

  

Multi-thread Imports in Dynamics 365 for Finance & Operations


There are a few perplexities on how to multi-thread your imports in Dynamics 365 for Finance and Operations. The primary thing to know is that Microsoft prevents you from multi-threading a few entities, which may be a great thing. Usually great since in Flow AX 2012 you'll multi-thread any substance and fundamentally, in case the arrange of the records getting imported is critical, at that point, multi-threading isn’t a great alternative since in case they go out of grouping due to records getting imported in parallel you'll degenerate your data.

The moment the thing to know is how to set up multi-threading in Dynamics 365FO. To do this you essentially go to Workspaces > Information Administration > Tap the System Parameters tile > Substance Settings tab > Press Arrange Substance Execution Parameters.



Within the entity execution parameters, you're defining how numerous strings ought to be utilized after you purport a substance in the group. You wish to get it merely can set up a substance at different times in this frame as seen below.





You're defining three things within the form:

Entity – What substance are you setting multi-threading up for.

Import threshold– The threshold tells the framework how numerous records got to be imported to utilize this line.

Import record count – How numerous strings ought to be utilized; aka how numerous assignments are created. Example Let’s walk through an illustration of bringing in the “Customer Definition” substance with 1360 records.

Next Actions

Create Import project, add the entity you added earlier in the execution parameters form, and import in the batch mode.


To verify multi threading go to the Batch job screen, find your job and check in the view task screen, you will find multiple threads of your task.


Support Faryal's Cusine


Archive inventory transactions D365FO

 

Archive inventory transactions


D365FO Data Archiving


In the 1st Quater of 2021, Microsoft introduced the most wanted feature of data archiving, although it is still not available for all tables and targeting only inventTrans table for the time being.

As per Microsoft's fast track, archiving is a very crucial topic for them, they know very well from time to time data of their client increase and client start registring the performance issues. 

Let's move to the topic:


How you can turn on this feature in your environment?


Navigate to Feature management, and turn on the Inventory transactions archive feature.



Important
Once you enabled the feature then you couldn't disable it again.


Prerequisites

Only during the times when the following conditions are met can inventory transactions be archived:

The ledger period has to come to an end.

Inventory closing must be performed on or after the archive's to-period date.

The period must begin at least one year before the archive's from-period date.

There must be no inventory recalculations in place.

Archive inventory transactions


Follow these steps to save inventory transactions.

To access the inventory transaction archive, go to Inventory management > Periodic chores > Clean up > Inventory transaction archive.

The Inventory Transactions Archive page appears, displaying a list of processed records that have been archived.



To generate an inventory transaction archive, go to the Action Pane and select Inventory transactions archive.

Set the following fields in the Inventory transactions archive dialog box's parameters FastTab:

Follow these steps to save inventory transactions.

  • Choose the earliest transaction date in the closed ledger period to include in the archive.
  • Select the most recent transaction date to include in the archive in the closed ledger period.



Set up batch processing details as needed on the Run in the background FastTab. In Microsoft Dynamics 365 Supply Chain Management, follow the regular batch job instructions.

Choose OK.

You get a notification asking you to confirm that you wish to keep going. If you want to continue, read the information carefully and select Yes.

The Inventory Transaction Logs Archive page shows your complete archive history. Each row in the grid displays information such as the date the file was created, the user who created it, and its status.




Support Faryal's Cusine


D365FO Batch Job retries

 

Enable automatic retries on batch jobs


In the April/May released, Microsoft introduces the feature to retry the batch job, In the past, if the Finance and Operations apps experience any kind of loss of connection to Microsoft SQL Server, then all batch jobs that are running fail, and the reason is, on Azure if the connection is lost then the recovery is almost impossible.

So, Microsoft introduces an Interface class that will batch to reset itself in case of connection loss or failure.

How you can implement it in your code?

Here is an example if you are using the "RunBaseBatch" class in your batch Job.

class TestBatchJob extends RunBaseBatch implements BatchRetryable

{

    [Wrappable(true), Replaceable(true)] // Change to meet your customizability requirements

    public boolean isRetryable() // Use final if you want to prevent overriding

    {

        return true; 

    }

}

 Here is an example if you are using the "SysOperationServiceController" class in your batch Job.

class TestBatchJob extends SysOperationServiceController implements BatchRetryable

{

    [Wrappable(true), Replaceable(true)] // Change to meet your customizability requirements

    public boolean isRetryable() // Use final if you want to prevent overriding

    {

        return true;

    }

}


Important

If you designing a multithreading job and adding the runtime task, then you should implement this interface on both the main controller and the task controller.


If you want to disable the retry of the batch job then add your class in the 

Batch class configuration overrides 


Overrides setup


Support Faryal's Cusine


Active batch periods

 


Reference link

 It was the most demanding requirement from almost every client that they want to execute some XYZ batch after some X number of hours but only after office hours. As we all know this feature was not available in any previous version of AX/D365FO. But with the release of Platform update 21, an additional level of control over when batch jobs screen is now available. 

Scenario covered:

You can configure the hourly Batch job 7 days a week, and can strict the job to execute only the given time window.

Scenario not covered:

You want to configure the hourly Batch job 7 days a week, But you want to execute the job for entire days on weekends or holidays.

Instruction to implement the feature

Go to System administration > Setup > Active periods for batch jobs.

References screenshot



Enter the name of the batch period group, and specify the start and end dates time that the batch job will be active, and save the records.

References screenshot


now go
 to System administration > Inquiries > Batch jobs and find your targeted batch job.

References screenshot


Find the active period column, click on edit and 
select the active period that you want to assign, and then click Save.

References screenshot









Support Faryal's Cusine


Release Product Using X++

 


Release Product Using X++

You can use the below code to release the product to any legal entity using X++ or a custom batch job.

Sample Code

static void ReleaseProducts(Args _args)

{

EcoResProduct ecoResProduct;

;

select firstOnly ecoResProduct where EcoResProduct.DisplayProductNumber == "7042"; //Audio system

EcoResProductReleaseManagerBase::releaseProduct(ecoResProduct.RecId,

CompanyInfo::findDataArea('USMF').RecId);

}


Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...