Quantcast
Channel: Microsoft Dynamics 365 Support : dynamics ax 2012
Viewing all 475 articles
Browse latest View live

AX Performance - Checking key SQL Server configuration and database settings

$
0
0

It's important to configure your SQL Server instance and your AX databases properly in order to achieve optimal performance on your Dynamics AX environment. This blog post aims to help you do that by providing some T-SQL scripts that can check key settings and highlight possible issues you need to address. The scripts don't cover all the things that can impact performance, nor do I at this stage go into details as to what the settings should be, but the information collected will be of interest to technical resources (including Microsoft Support) and could establish some quick wins that you can implement.

If you’re interested in investigating these settings in more depth yourself, the following blog post by my colleague Glen Turnbull provides some additional reference materials:

http://blogs.msdn.com/b/axsupport/archive/2014/09/05/ax-performance-troubleshooting-checklist-part-1a-introduction-and-sql-configuration.aspx

I also intend to publish more information on these topics later.

You can use the scripts attached below to check your current key SQL Server configuration and database settings to see if you need to make some changes at the instance or database level. There is a script for AX 2009, AX 2012 RTM, and AX 2012 R2/R3, so please select the appropriate one and run it from SQL Server Management Studio (SSMS). You can either send the output to screen and take some screenshots, or save the output as a report. You may need to adapt the scripts slightly to get them to collect the information we are interested in analyzing if you use non-standard AX database names.

-- Disclaimer:
--

-- Microsoft provides programming examples for illustration only, without warranty
-- either expressed or implied, including, but not limited to,
-- the implied warranties of merchantability or fitness for a particular purpose.
-- This mail message assumes that you are familiar with the programming language that
-- is being demonstrated and the tools that are used to create and debug procedures.
--
-- This source code is freeware and is provided on an "as is" basis without warranties of any kind,
-- whether express or implied, including without limitation warranties that the code is free of defect,
-- fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of
-- the code is with the end user.
--
-- Please note that you may need to adjust the scripts a little if your AX database names are non-standard


AX Performance - Analyzing key SQL Server configuration and database settings

$
0
0

In the previous post in this series, I provided some T-SQL scripts that can check key settings and highlight possible issues you need to address. This post aims to provide some feedback and suggestions on the information the scripts collect. There are of course different views on almost all SQL Server configuration settings, but the comments I will make are intended to be as in line as possible with other public documentation and Microsoft policies and best practices. I will approach this from a Microsoft Dynamics AX perspective, first and foremost, though general SQL Server configuration guidance still applies to instances running an AX workload.

MSDN Blogs  >  Microsoft Dynamics AX Support   >  AX Performance - Checking key SQL Server configuration and database settings
http://blogs.msdn.com/b/axsupport/archive/2015/09/22/ax-performance-checking-key-sql-server-configuration-and-database-settings.aspx

The
scripts I provided look at the SQL Server instance and the AX databases deployed there. Let's start by looking at the SQL Server instance you are using to run your AX databases on. For background information on this area, please see the official Microsoft Dynamics AX documentation, e.g.:

SQL Server topology recommendations for availability and performance [AX 2012]
https://technet.microsoft.com/en-us/library/dd362068.aspx

ConfigureSQL Server and storage settings [AX 2012]

https://technet.microsoft.com/en-us/library/dd309734.aspx

I
also recommend that you take a look at the 'SQL Optimization for Microsoft Dynamics AX 2012' training courses (80428 and 80696) if you have access to the Microsoft Dynamics Learning Portal.

Microsoft Dynamics Learning Portal | AX | Course Catalog
https://mbspartner.microsoft.com/AX/CourseResources/

1
. AX Instance Config

*** I ran the script on a machine hosting a recent AX 2012 R3 build on SQL Server 2014 ***

What does the script output tell us here? Well, it shows us what kind of SQL Server instance we are running, at what build and edition, and how it has been configured when it comes to TempDB data files per core. We can also see if Lock Pages in Memory (LPiM) has been enabled, if priority boost is on or off, and if 'max server memory (MB)' has been set to a static value or not. Finally, we can see if MAXDOP is set to 1 or some other value, and for good measure, we can see a snapshot of a few SQL Server performance counters like Page life expectancy (PLE) and total and target server memory in KB. We would also see any I/O warning messages and paging errors found in the SQL Server ERRORLOG (i.e. '...IO requests taking longer than 15 seconds to complete...' and 'A significant part of sql server process memory has been paged out...')

I would usually recommend the following, which again, should be in line with other public documentation and Microsoft policies and best practices:

SQL Server Builds

Generally speaking, I would recommend that you keep your SQL Server instance updated and in a supported state.

You'll need to refer to the Microsoft Dynamics AX System Requirements (which are updated regularly)

Microsoft Dynamics AX 2012 System Requirements
http://www.microsoft.com/en-gb/download/details.aspx?id=11094

You should also regularly check the Dynamics AX In-Market Engineering blog for compatibility statements to ensure that you are in a supported state.

TechNet Blogs » Dynamics AX In-Market Engineering » All Tags » compatibility
http://blogs.technet.com/b/dynamicsaxse/archive/tags/compatibility/

It's usually a good idea to run your PRODSQL Server instance on a recent (high) Service Pack (SP) and Cumulative Update (CU)

TempDB Data Files

As you can see, I have 4 TempDB data files on this 4 core SQL Server instance. I'd go with 1 per core up to 8 cores. 

MSDN Blogs  >  Dynamics Ax Performance Team Blog   >  Ax Database Configuration Checklist Part 2 -- TempDB --
http://blogs.msdn.com/b/axperf/archive/2008/03/13/ax-database-configuration-checklist-part-2.aspx

"Determine total size of data and transaction log required for tempdb to avoid autogrow, and number of data files required based on # of processors (logical or physical)."

I'd set my TempDB data files to grow and the same rate in MB, not %

Lock Pages in Memory (LPiM) and ‘max server memory (MB)’

Generally speaking, I'd recommend enabling LPiM on x64 systems these days, but there are scenarios where LPiM is not appropriate. If you enable it, ensure that you also set 'max server memory (MB)' to a reasonable static value. If you are on an older version of SQL Server STANDARD EDITION, you may need to implement trace flag 845 to be able to enable LPiM.

As with any other major change to a critical production system, you should test this before you make the change in production and be ready to remove it if you run into problems

How to reduce paging of buffer pool memory in the 64-bit version of SQL Server
http://support.microsoft.com/kb/918483

How
to enable the "locked pages" feature in SQL Server 2012
http://support.microsoft.com/kb/2659143

Once
you have set the Lock Pages In Memory privilege on SQL Server 2012 you should see this sort of messages in the ERRORLOG on startup:

2015-09-20 12:13:14.250 Server Using locked pages in the memory manager

Do not enable LPiM without setting ‘max server memory (MB)’

If you are running a clustered instance, it is important to verify that LPiM works ok regardless of which node is active.

If you are running more than one instance on the same cluster nodes, ensure that your LPiM and ‘max server memory (MB)’ settings are suitable for your failover scenarios.

Trace flags

Based on experience, I would usually go with trace flags 1117, 1118, and 4199, but you may also need to look at 845, 1224 and 2371 depending on scenario. 

Trace flag 1117 - http://blogs.msdn.com/b/axperf/archive/2011/09/12/consider-enabling-trace-flag-1117-on-dynamics-ax-sql-server.aspx 

Trace flag1118 - http://blogs.msdn.com/b/psssql/archive/2008/12/17/sql-server-2005-and-2008-trace-flag-1118-t1118-usage.aspx

Trace
flag4199 - http://blogs.msdn.com/b/axinthefield/archive/2010/11/04/sql-server-trace-flags-for-dynamics-ax.aspx

Trace
flag2371 - http://blogs.msdn.com/b/axinthefield/archive/2013/10/07/sql-server-trace-flag-2371-for-dynamics-ax.aspx

One
of my colleagues in the AX PFE Team has also blogged about this area recently:

MSDN Blogs  >  Dynamics AX in the Field   >  Dynamics AX and SQL Server Trace Flags, Quick and Dirty
http://blogs.msdn.com/b/axinthefield/archive/2014/05/08/dynamics-ax-and-sql-server-trace-flags-quick-and-dirty.aspx

Priority Boost

We see this set to 1 on very rare occasions. It should be set to 0.

Configure the priority boost Server Configuration Option
https://msdn.microsoft.com/en-us/library/ms188709.aspx

"Raising the priority too high may drain resources from essential operating system and network functions, resulting in problems shutting down SQL Server or using other operating system tasks on the server."

Max degree of parallelism (MAXDOP)

As a SQL Server DBA you may have some views on MAXDOP, but from an AX perspective we recommend that you set MAXDOP to 1.

MSDN Blogs  >  Dynamics Ax Performance Team Blog   >  Welcome -- Ax Database Configuration Checklist part 1 -- MAXDOP --
http://blogs.msdn.com/b/axperf/archive/2008/03/10/welcome-database-configuration-checklist-part-1.aspx

“Dynamics AX OLTP workloads generally perform better when intraquery parallelism is disabled, but the upgrade process benefits from parallelism.”

Configure SQL Server and storage settings [AX 2012]
http://technet.microsoft.com/en-us/library/dd309734.aspx

Microsoft Dynamics AX workloads generally perform better when intra-query parallelism is disabled. However, the upgrade process benefits from parallelism, as do activities that are used exclusively for batch jobs or maintenance.”

MSDN Blogs  >  Dynamics AX in the Field   >  Database Maintenance Strategies for Dynamics AX -- MAXDOP --
http://blogs.msdn.com/b/axinthefield/archive/2012/08/01/database-maintenance-strategies-for-dynamics-ax.aspx

“In Dynamics AX databases, it is recommended to run with a max_degree_of_parallelism (MAXDOP) option of 1. However, a REBUILD benefits highly from parallelism. Developer and Enterprise Editions support temporarily altering the MAXDOP setting as part of the ALTER command. You can change this by specifying the WITH(MAXDOP = n) option where n is the number of cores in your server up to a maximum of 8.”

Perfmon Counters

This is a snapshot so perhaps of limited value, but if it shows very low PLE, for example, you should look into memory consumption in more detail.

MSDN Blogs  >  MCS UK Data Platform and Business Intelligence Team   >  SQL Server Page Life Expectancy
http://blogs.msdn.com/b/mcsukbi/archive/2013/04/12/sql-server-page-life-expectancy.aspx

Now
that we've looked at the SQL instance level, let's focus on the AX database level.

2. AX Database Config

*** I ran the script on a machine hosting a recent AX 2012 R3 build on SQL Server 2014 ***

The output from the script shows us how the AX databases and the TempDB have been configured. We can see what compatibility level they are running at, and what their collations are set to. We can see the recovery model, and establish if RCSI has been enabled or not.

Ensure that your databases are using the same compatibility level and collation, and that you've chosen a suitable recovery model, e.g. FULL if in PROD. Also ensure that RCSI has been enabled OK.



Parameter Sniffing Mitigation Functionality

The last set of queries show you how your AX environment is configured with regards to passing in DATAAREAID and PARTITION (R2 and R3 only) as LITERALS, and in order to establish if that might be a good idea, we check to see if you have one or more PARTITION and if you have many AX companies (DATAAREAIDs).

I would usually recommend that you ENABLE this functionality (i.e. VALUE = 1), which has certain pre-requisites when it comes to AX kernel builds etc., as you can see here:

MSDN Blogs  >  Dynamics AX in the Field   >  SQL Server Parameter Sniffing with Dynamics AX, just plain evil
http://blogs.msdn.com/b/axinthefield/archive/2014/01/09/sql-server-parameter-sniffing-with-dynamics-ax-just-plain-evil.aspx 

On an AX 2012 R2 or AX 2012 R3 environment you would run this sort of UPDATE command to enable the functionality:

UPDATE SYSGLOBALCONFIGURATION
SET [VALUE] = 1
WHERE NAME IN ('DATAAREAIDLITERAL','PARTITIONLITERAL')

Note that you'll need to restart your AOS for the new settings to take effect.

3. Other settings that can impact performance which the scripts don't cover

As mentioned in the original post, there are other factors that can impact performance that the scripts I published don't look at for a variety of reasons. 

BIOS

Ensure that your BIOS settings provide the maximum performance your hardware is capable of delivering (this will vary by manufacturer)

MSDN Blogs  >  Microsoft Dynamics AX Support   >  Dynamics AX - Power options
http://blogs.msdn.com/b/axsupport/archive/2014/01/10/dynamics-ax-power-options.aspx

OS Settings

Ensure that you have set your servers to use a high performance power plan and they are optimized for background services.

Power Options = High performance -
http://blogs.msdn.com/b/cindygross/archive/2011/03/09/power-saving-options-on-sql-server.aspx


Processor Scheduling = Background services - http://technet.microsoft.com/en-us/magazine/ff458358.aspx

Maintenance Strategy

Ensure that you have a valid database maintenance strategy.

MSDN Blogs  >  Dynamics AX in the Field   >  Database Maintenance Strategies for Dynamics AX
http://blogs.msdn.com/b/axinthefield/archive/2012/08/01/database-maintenance-strategies-for-dynamics-ax.aspx

Builds

Last but not least, ensure that you are patching your Dynamics AX environment and running recent builds of both the AX kernel and AX application to get the full benefits of the code fixes that are released (use LCS to find them!)

MSDN Blogs  >  Dynamics AX in the Field   >  Patching Strategy for Dynamics AX
http://blogs.msdn.com/b/axinthefield/archive/2014/08/22/patching-strategy-for-dynamics-ax.aspx

MSDN Blogs  >  Microsoft Dynamics AX Support   >  Overview of Microsoft Dynamics AX build numbers

http://blogs.msdn.com/b/axsupport/archive/2012/03/29/overview-of-ax-build-numbers.aspx

Issue search (Lifecycle Services, LCS) [AX 2012]
https://technet.microsoft.com/en-us/library/dn268610.aspx

How to install and set up integration with MS Project in AX 2012 R3 successfully the first time

$
0
0

Before you begin

Integration with MS Project is done as an Office add-in for Dynamics AX 2012.
When you install Office add-ins for Dynamics AX 2012 it will only install the add-ins for the Office products that are installed on the client. If you did not have MS Project installed the first time you installed the AX Office add-ins, then you have to uninstall the Office add-ins using the AX 2012 setup. Then install MS Project and reinstall the Office add-ins using AX 2012 setup.

Important
There is released a binary/kernel hotfix (KB 3000048) for Dynamics AX 2012 R3 that fixes a problem with date format causing the sync to fail if you use other regional settings/date format than US format (selecting non US format in Control panel/Region).

The hotfix (KB 3000048) can be downloaded from LCS:
https://fix.lcs.dynamics.com/Issue/Resolved/61276?kb=3000048&bugId=1734382&qc=6599315e2669bca422ce1e83ead57375

The AX kernel version for KB 3000048 is 6.3.164.3179 so if you are running with a kernel with higher build number, then you already have the fix.

Note:
When you install the AX Office add-ins then be sure that the KB 3000048 kernel or kernel hotfix with higher build number is slipstreamed with the AX Setup files.
https://technet.microsoft.com/en-us/library/hh378076.aspx

 

Installation 

When you are ready to install, then this is a god guide to follow when installing MS Project integration:
http://blogs.msdn.com/b/axsa/archive/2014/05/14/project-integration-in-microsoft-dynamics-ax-2012-r3.aspx

 

Setup after installation

Check that the services for project integration, AifProject and AifProjWBS, is deployed and Activated.
System administration > Services and Application Integration Framework > Inbound ports

If not activated, then Activate them by select the port and click Activate button.
If not deployed, then open AOT (developer workspace) in AX client.
Go to AOT > Service Groups > AifProject > right click and Deploy Service.
Go to AOT > Service Groups > AifProjWBS > right click and Deploy Service.

 

AX client configuration

The MS Project integration is designed to use the default client and Business Connector configuration and there is no option to specify a configuration file, so you can only connect to one AOS/AX system at the time.
If you need to connect to another AX environment (e.g. if you have a prod and test system), then you need to open AX client configuration utility (from Administrative tools).
For both configuration targets – AX client and Business connector:
Select the configuration for the other AX system and click Apply.
Note: You can have only one AX client and one MS Project instance open at the same time.

 

Set up parameters for Microsoft Project integration

Go to Project management and accounting > Setup > Project management and accounting parameters > General
Specify where to save the project files.

If you select “Local or network folder”:
Do not use _ (underscore) in the folder path/name.
Example: Do not use \\server\Project_Files - use \\server\Project Files or \\server\ProjectFiles
Use a network folder (UNC path) in multi user environment. Local is only for single machine test environment.

 

It is also possible to select to store the project files in SharePoint Collaboration workspace.
You can store Microsoft Project files in Microsoft SharePoint only if the associated collaboration workspace is using a project site template or team site template. You can change those settings in the Collaboration workspace settings form.

Be sure that all project users have access to the folder/workspace where the project files are stored.

 

Project categories

 

In order to be able to select Project categories in MS Project then the Project Category (Project management and accounting > Setup > Categories > Project categories) must be set up as Transaction type = Hour and Active in journals = enabled.

All Project categories specified on WBS lines must have this setup.

 

Some links to documentation and info:

 

TechNet doc:
https://technet.microsoft.com/en-us/library/dn528663.aspx

 

Project Management whitepapers:
http://blogs.msdn.com/b/axsupport/archive/2014/06/02/ax-content-microsoft-dynamics-ax-2012-r3-white-papers-for-microsoft-project.aspx

 

Project Management demo on YouTube:
https://www.youtube.com/watch?v=XZrILEvTRBQ&feature=youtu.be

When the Download button in not available on the LCS Issue search

$
0
0

Sometimes you may find a fix like KB2975071 that has been released for both AX2012 R2 and AX2012 R3.

The issue is the Download button is only available for AX2012 R2, but not for AX2012 R3.

The hotfix process of the In-Market Engineering team is that they release a fix for the customer that reported the problem for their version. Then they port the fix into the future versions and it will become available in the next cumulative update for those versions. In order to download and install the individual hotfix other customers should be able to use Update Installer on LCS or download a latest cumulative update and chose Advanced Installation option.

AX Performance - What information and data to collect when you want to open a support case

$
0
0

The aim of this blog post is to provide you with some suggestions on what information and data to collect and provide when opening a Microsoft support case. You can of course use these suggestions in your own organization too, whether you are a Partner or End User of Microsoft Dynamics AX. It's usually a good idea to have a structured and repeatable approach to data collection and performance troubleshooting, though it can of course be hard to come up with a single template that covers all scenarios. Let's start with some comments from our In-Market Engineering Team: 

TechNet Blogs »  Dynamics AX In-Market Engineering »  Improve your chances for fast case turnaround
http://blogs.technet.com/b/dynamicsaxse/archive/2013/05/13/improve-your-chances-for-fast-case-turnaround.aspx

Secondly, if you are experiencing general performance issues, you should take a look at this blog post first:

MSDN Blogs  >  Microsoft Dynamics AX Support   >  Managing general performance issues in Microsoft Dynamics AX
http://blogs.msdn.com/b/axsupport/archive/2014/09/11/managing-general-performance-issues-in-microsoft-dynamics-ax.aspx

So what can you provide Microsoft support with that will help us expedite your AX performance case from the start?

1. A good problem description

It should include things like background on whether the issue happens often, consistently, intermittently, for specific users only, etc. It's also usually interesting to hear if the issue has been occurring for a long time, or if it has started happening recently, and if there have been any recent changes or not. If you are having problems with a specific form or process, and you have identified some X++ call stacks, please provide that information. We are also interested in your observations and ideas when it comes to a possible cause. Finally, if you have made customizations to the area you are seeing issues with, that is of course relevant, and we'd also be interested to know if you have an unusually large amount of data in the underlying tables being queried. 

TIP:

Even if you've spent a lot of time putting together a very comprehensive problem description written in a Microsoft Word document, please ensure that there are a few lines in the case description in clear text that outline the main issue, rather than simply writing "see attached document". This will allow us to more quickly route your case to an appropriate Engineer. Almost any performance issue can usually be summarized in a sentence or two, regardless of complexity, in my experience. This is part of the normal case SCOPING process we follow here at Microsoft Support.

2. AX build numbers

These are a must. We need to know your AX kernel build and your AX application build. We may also need more insights into individual fixes you may have installed.

To check your current AX builds, go to:

AX CLIENT / HELP / About Microsoft Dynamics AX

e.g.



3. AX traces

AX traces are usually a great source of information when it comes to troubleshooting a performance issue.

AX 2009

To capture AX traces on AX 2009, you use the Microsoft Dynamics AX Server Configuration Utility on the AOS and the Dynamics AX Configuration Utility on a client.

AX 2009 - Tracing
https://technet.microsoft.com/en-us/library/aa496440(v=ax.50).aspx

AX 2009 - Set tracing options
https://technet.microsoft.com/en-US/library/aa569614(v=ax.50).aspx

AX 2012 RTM / R2 / R3

When it comes to AX 2012 onwards, I prefer to use PERFMON to capture AX traces personally, as once it has been set up, all you have to do is press PLAY / STOP in PERFMON and you will get consistent data capture with minimum effort.

MSDN Blogs  >  Dynamics Ax Performance Team Blog   >  Collect AX 2012 event traces with Windows Performance Monitor
http://blogs.msdn.com/b/axperf/archive/2011/11/18/collect-ax-2012-event-traces-with-windows-performance-monitor.aspx



Alternatively, you can use the Tracing Cockpit form.

Tools for monitoring performance [AX 2012]
https://technet.microsoft.com/en-us/library/jj149695.aspx

4. DynamicsPerf database backups

Installing and running Performance Analyzer for Microsoft Dynamics (DynamicsPerf) also has many benefits, and the tool can be very helpful in establishing the cause of a performance issue.

There are some good blog posts out there when it comes to DynamicsPerf so please take a look at those, e.g.:

MSDN Blogs  >  Microsoft Dynamics AX Support   >  Troubleshooting that elusive “slowdown” in AX using Performance Analyzer 1.20 for Microsoft Dynamics
http://blogs.msdn.com/b/axsupport/archive/2015/02/18/troubleshooting-that-elusive-slowdown-in-ax-using-performance-analyzer-1-20-for-microsoft-dynamics.aspx

MSDN Blogs  >  Dynamics AX in the Field   >  All Tags  >  performance analyzer for dynamics
http://blogs.msdn.com/b/axinthefield/archive/tags/performance+analyzer+for+dynamics/

The tool itself can be downloaded here:

Performance Analyzer for Microsoft Dynamics
http://dynamicsperf.codeplex.com/releases/view/122779

If you install DynamicsPerf then you can also set up the following:

AX Long Query Tracing

If you aren't able to capture an AX trace for some reason, you may be able to set up long query tracing and establish what X++ call stacks and SQL statements are taking time to run.

Tracing with the Tools Menu [AX 2012]
https://msdn.microsoft.com/en-us/library/aa854677.aspx

MSDN Blogs  >  Dynamics AX in the Field   >  How to Monitor for Long Running Queries in AX
http://blogs.msdn.com/b/axinthefield/archive/2011/06/09/how-to-monitor-for-long-running-queries-in-ax.aspx

I would usually suggest that you establish a reasonable threshold and log the information to a database table.



This is also covered in the DynamicsPerf documentation:

MSDN Blogs  >  Dynamics AX in the Field   >  Performance Analyzer for Microsoft Dynamics 1.20 Deployment Guide Dynamics AX Installation
http://blogs.msdn.com/b/axinthefield/archive/2014/05/29/performance-analyzer-for-microsoft-dynamics-1-20-deployment-guide-dynamics-ax-installation.aspx

TIP:

Once this has been enabled, we should hopefully capture some long running queries in a table in the AX 2012 RTM / R2 / R3 database called SYSTRACETABLESQL

To see how may rows the table contains, run this query: 

SELECTCOUNT(*)AS myRowCount_SYSTRACETABLESQL FROM SYSTRACETABLESQL 
GO

Once you’ve captured some data, you can run something like this to collect the top 50 slowest queries into a new table in a new database, which you can then take a backup of and send to Microsoft for further analysis. 

CREATE DATABASE DB_MSFT_LONG_QUERIES -- YOU ONLY NEED TO RUN THIS ONCE TO CREATE A NEW EMPTY DB 
GO

-- Top 50 slowest queries taking more than a second to run 
SELECT TOP 50 [DATAAREAID], [CREATEDDATETIME] , [CREATEDBY], [TRACETIME], [CALLSTACK], [STATEMENT] 
INTO DB_MSFT_LONG_QUERIES.dbo.MSFT_LONG_QUERIES_TOP_50 
FROM SYSTRACETABLESQL 
WHERE [TRACETIME] >1000  
ORDER BY TRACETIME DESC 
GO 

We can then run queries like this to filter the data further, for example: 

SELECT * FROM DB_MSFT_LONG_QUERIES.dbo.MSFT_LONG_QUERIES_TOP_50 WHERE CALLSTACK LIKE '%SalesTable%' 
GO 

e.g.  


 
The BACKUP to DISK command would look something like this (ensure you can write data to the path used of course): 

BACKUP DATABASE [DB_MSFT_LONG_QUERIES]  
TO  DISK = N'C:\TEMP\DB_MSFT_LONG_QUERIES.BAK' WITH NOFORMAT, NOINIT,
NAME = N'DB_MSFT_LONG_QUERIES-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 
GO 

SQL Server Profiler traces

Profiler traces can also provide valuable insights, though it is important to be able to tie the SQL statements back to an X++ call stack in the majority of AX performance scenarios. A Profiler trace is usually most useful in blocking scenarios, but again, you may need an AX trace too in order to be able to tie back the information displayed in the blocked process report, for example, in order to establish what X++ has generated the blocking SQL statement.

This blog post covers some of specifics when it comes to using SQL Server Profiler in blocking scenarios.

MSDN Blogs  >  Microsoft Dynamics AX Support   >  AX Performance Troubleshooting Checklist Part 2
http://blogs.msdn.com/b/axsupport/archive/2014/09/08/ax-performance-troubleshooting-checklist-part-2.aspx

The documentation that DynamicsPerf comes with covers how to set it up, as do numerous other general SQL Server blogs and walk-throughs.

Performance Monitor traces

Perfmon traces can be useful too, depending on scenario, and can be set up manually or in conjunction with installing and running DynamicsPerf

Set up Performance Monitor counters [AX 2012]
https://technet.microsoft.com/en-us/library/aa834416.aspx

For more information on how to set this up and use PAL to analyze the data, see this blog post:

MSDN Blogs  >  Microsoft Dynamics AX Support   >  AX Performance Troubleshooting Checklist Part 2
http://blogs.msdn.com/b/axsupport/archive/2014/09/08/ax-performance-troubleshooting-checklist-part-2.aspx

The DynamicsPerf tool ships with a Perfmon template that you can use to collect AOS performance counters, for example, called Server2008_AOS.xml.


5. LCS Cloud Powered Support with Repro VM

Finally, and perhaps most importantly, if you have found a performance issue that can easily be reproduced on standard AX, you should consider using LCS to log a case and provide a repro VM where you can illustrate the issue and record a repro video of it for an Engineer to look at and troubleshoot

Cloud-powered support (Lifecycle Services, LCS) [AX 2012]

https://technet.microsoft.com/en-us/library/dn715995.aspx



 

Customer aging snapshot performance improvement approach through parallel batch execution

$
0
0



The aim of this blog post is to illustrate an effective  way which helps to receive your desired data output from the Customer aging snapshot faster when your amount of relevant customers is rather high. Of course, you may  use this idea for other batches as well.

Idea:  

Instead of running the Customer aging snapshot (AX client: [Company]\Accounts receivables\Periodic\Collections\Customer aging snapshot) in 1 batch for all involved customer, split your customers into separate pools and run 1 batch per pool on dedicated batch servers (if available) 


Example:

  • Your MS Dynamics AX installation  consists of 20.000 customer accounts and 2 physically different dedicated AOS batch servers
  • You setup 2 different pools (AX client: [Company]\Accounts receivables\Setup\Collections\Customer pools) for your customer accounts:

    Pool 1 consists of customers where the first letter of the customer’s name starts with A-M
    Pool 2 consists of customers where the first letter of the customer’s name is starts with  N-Z
  • You create 2 different batches and assign each pool to one of those 2 batches
  • You assign the execution of batch 1 to AOS server 1 and  the execution of batch 2 to AOS server 2.


Additional notes:

For optimal batch execution on the different batch servers it is important that no other resource intensive batches are running in parallel on the AOS batch servers at the same time.
The amount of pools and customers per pool and batches can be different in different customer installations. My main aim here in this blog post has been to pick numbers which show the principle as “easy-to-follow” as possible.

How to change the Storage dimension group on items with existing Inventory transactions

$
0
0

I have seen numerous occurrences of customers needing to change the storage dimension group on an item with existing inventory transactions.  This unfortunately can be a time consuming process, but it is important to do this the correct way to avoid data corruption and potential ledger implications.  Rather than taking the non-supported route by performing changes in the back-end, I would recommend the following:

  1. Count inventory down to zero.  You will need to temporarily remove any existing reservations, registrations, etc.
  2. Perform an Inventory close (Inventory management > Periodic > Closing and adjustment)
  3. After performing the inventory close, you can change the storage dimension group at the Released item level. 
  4. Note that you will not be able to make this change unless the current session date is after the date of Inventory closing.

Yes, this is a much more time consuming process than making updates via SQL or other unsupported methods, but is essential to ensuring that the integrity of your data is maintained. 

Checking your MS Dynamics AX users against Active Directory domain resolution

$
0
0

In this blog post I’d like to present the following X++ scipt which you may run as a job if you like. The purpose of this script is to go through all of your users in the MS Dynamics AX security system and check if their SID can be successfully resolved against your Active Directory (AD) domain.
In case there should be an issue you will receive an infolog message which lists the affected users.

Please take the following disclaimer into consideration here:

“Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This mail message assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures.

 

static void ADDomainResolution(Args _args)
{
  xAxaptaUserManager axUsrMgr;
  xAxaptaUserDetails axUsrDet;
  UserInfo userInfo;
  str userID;
  str domainName;
  str userSid;
  userAccountType accountType;


  axUsrMgr = new xAxaptaUserManager();
  while select * from userInfo where userInfo.enable == true
  {
    userID = userInfo.networkAlias;
    domainName = userInfo.networkDomain;
    accountType = userInfo.accountType;
    try
    {
      axUsrDet = axUsrMgr.getSIDFromName(userID, domainName, accountType);
    }
    catch(Exception::Error)
    {
      info(domainName + '\\' + userId + ': caused an exception');
    }
  }
}


BOM Journal postings in AX 2012 R3 vs. earlier versions of AX 2012

$
0
0

I have recently done some investigation in regards to the accounting transactions taking place during the posting of BOM journals in AX 2012 R3, and have found that there is a difference in the accounting transactions taking place in AX 2012 R3 vs. what was experienced in earlier versions of AX 2012. Please consider the following results of posting BOM journals in AX 2012 R2 vs. earlier versions of AX 2012:

1.  AX 2012 R3:

a.  Inventory and warehouse management | Setup | Inventory | Item groups, Production tab:

- Production, receipt: Inventory account for finished products (Debit)

- Production, issue: Inventory account for materials (Credit)

b. Inventory and warehouse management | Setup | Inventory | Item groups, Inventory tab:

- Inventory, profit: Profit account for inventory profit (Debit)

- Inventory, loss: Loss account for inventory loss (Credit)

2.  AX 2012 R2 and earlier:

a. Inventory and warehouse management | Setup | Inventory | Item groups, Production tab:

- Production, receipt: Inventory account for finished products (Debit)

- Production, issue: Inventory account for materials (Credit)

- Production, issue offset: WIP account (Debit)

- Production, receipt offset: WIP account (Credit)

 

The reason why changes were made in AX 2012 R3 relative to the accounting transactions taking place during BOM journal posting is due to the following:

-  Retail introduced the concepts of Kitting and De-kitting and this could lead to the fact that balances were caught on WIP accounts that would never be cleared out. As WIP are balance sheet accounts in nature, this would lead to incorrect results.

- When making a negative BOM journal and running Inventory close, the system does not ripple the adjustments correctly back through the Raw materials which would leave a difference in WIP.

 

I hope that this information is helpful for those exploring BOM journal functionality across versions of AX 2012!

DIXF - Importing Data - How to establish which rows you need to look at when you aren't able to import every row in your input file

$
0
0

Consider a scenario where you are importing a lot of data using DIXF, but one or more of the rows in the input file contain "bad data" that result in some rows not being imported OK into your staging table. How do you establish which rows are the problem, so that you can correct them?

In the example below, I am working with the Units demo data file (CSV - delimited) that ships with AX 2012 R3.

You can usually find this file here:

C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\DemoFiles\Delimited

In this example, I have copied the UnitOfMeasureEntity.txt file to another folder called C:\DIXF_IMPORT , renamed the file and called it 'MSFT_UnitOfMeasureEntity.txt' and I've edited one of the 6 rows in it so that it will generate an error.

The file I am working with looks like this:

Please note that the file header column info (Symbol, DecimalPrecision, etc.) has been truncated - Check the real sample data file for the details

----------------------------------------------------------------------------------------
Symbol,DecimalPrecision,IsBaseUnit,IsSystemUnit,SystemOfUnits,UnitOfMeasureClass,UOMInternalCode_CodeSymbol,UOMTranslation_Description

DIXF_AA,1,No,No,Metric units,Undefined,Weeks,Inches
DIXF_AB,2,No,No,Metric units,Mass,Years,Kilograms
DIXF_AC,0,No,No,None,Undefined,Milliseconds,Kilometers
DIXF_AD,---,No,No,United States customary units,Mass,Days,Pounds
DIXF_AE,0,No,No,United States customary units,Mass,Seconds,Pint
DIXF_AF,1,No,No,United States customary units,Undefined,Metric tons,1/8 square inch
----------------------------------------------------------------------------------------

The change I've made is highlighted in red above.

1. The error

When I try to import the Units entity data file shown above into staging, I get the following error:



Warning Message (17:46:01) The file for entity Units is having 1 error(s)
Info Message    (17:46:01) '0' 'Units' record(s) inserted in staging
Warning Message (17:46:01) For additional warnings or errors, please check the log

2. How to find the relevant rows in the input file that need to be fixed

There are at least two ways to establish what rows in your input file are causing problems.


Data import/export framework parameters / Create error file


Navigate to /Data import export framework/Setup , click on 'Data import/export framework parameters', and check the 'Create error file' checkbox.

Once you've done this, you can re-run your 'Get staging data' process and any errors will be captured in an error file for review.


Staging data execution (DMFStagingData form) / Details / Create error file

If you haven't enabled this functionality using the method described above, and you want to enable it for a particular Processing group that you are importing into staging, you can also do that.

Navigate to /Data import export framework/Common, click on 'Processing group', select the relevant 'Processing group' (in this case it is Units) and click on 'Get staging data'.



When the subsequent screen appears, click on the 'Details' link and check the 'Create error file' checkbox, and finally, on 'Run'.



Again, any errors will be captured in an error file for review.

You can review the error file by looking at the 'Execution history' of your 'Processing group', then clicking on 'Error log' followed by 'View error file'.



3. Get staging data again once the errors in your input file have been corrected


Once I put a valid DecimalPrecision value in my input file and re-run the 'Get staging data' processing, the 6 rows in my input file are imported into staging OK.



InfoLog shows successful import.



Data visible OK in the staging table in the SQL Server database.

  

 

 




 

 

 

 

How to resolve the message “Report data source XYZ cube was not found” when you click the Analyze data button in Dynamics AX 2012

$
0
0

You can use Power View to create interactive ad-hoc reports in Microsoft Dynamics AX. Several list pages have an Analyze data button that launches a Power View report designer. The Power View report designer connects to an Analysis Cube and allows you to drag and drop fields for quick analysis.

While using this functionality you may receive a notification that the cube, which this report uses as a data source, has not yet been deployed.

 Below is an example of what you may see:

“The Inventory value cube, which this report uses as a data source, has not yet been deployed. Deploy the Inventory value cube and then run this report again.”

 

Review the menu item to identify the class that is being used when you click on Analyze Data button, you will see this is linked to the Power View Report Data Sources in Enterprise Portal.

Use below steps to figure out which class it uses –

1. Right click on grid > Personalize, personalization window will open up with tabs Layout Information, Query
2. Layout tab > Navigate to the ActionPane > Manage costs > Reporting > Analyze data
3. See the system name field on the window, it is linked to class PowerViewReport  

 Go to the Power View Reports site /sites/DynamicsAx/Power%20View%20Reports/">http://<server_name>/sites/DynamicsAx/Power%20View%20Reports/.
Note: The Inventory value cube is not deployed.

These data sources are primarily deployed through AOT as below –
1. AOT > Web > Web Files > Page Definitions node
2. Right-click PowerViewDataSourceGeneratorPV and click Deploy Elements.
The Inventory Value Cube is not part of the standard Data Sources AX deploys so you are required to manually create it.

Below are steps to create this cube manually –
1. Open http://server/sites/DynamicsAx/Power%20View%20Reports/
2. Name must be exactly as requested "Inventory Value Cube"
3. Set the Data Source Type to 'Microsoft BI Semantic Model for Power View'
4. Connection String below –
Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Data Source=DAX2012R2;Initial Catalog=Dynamics AX initial;Locale identifier=1033;Cube=Inventory Value cube


Thanks to the contributor - James Wang

Belgian EUSalesList xml file missing the sending company's contact information

$
0
0

If you viewing XML file created by AX to report the EU Sales to Belgian
authorities and experience that the XML file doesn’t
include the company's contact information such as the user's email and Phone number in
the xml file header. This information is mandatory on the INTERVAT website and without
this information the XML file generated file will be rejected.

We have released KB3003995 “Company electronic address
is not marked as IsPrimary for the location when creating a new company”. But
if the “New” legal entity have been created before the KB or the KB isn’t installed
you may check and update this manually.

This issue happens because while generting EUsalesReporting, system uses the
AXDEUSLReporting query. In query for dirpartylocation datasource and to this
datasource, records are filtered based on condition Isprimary. But for new
created Legal entities and while creating electronic address for these new
legal entity- Isprimary is never marked as true, so because of ElectronicAddress
not being marked as primary in DirpartyLocation, so Dirpartylocation record
related to electronic Address is not being fetched and hence Contact
Information is not reflecting on the EUSalesListreport.

And please remember to re-load the EU Sales list XSLT document after HF update.

If the company is already created and in use you may need to fix this
manually….

Please validate the status of the tick box IsPrimary in the DirPartyLocation
table? Which address RECID can be found in LogisticsElectronicAddress.

If you have this issue would expect that in that case this box in
DirPartyLocation table will be blank so as a work around I suggest to mark it
and save and rerun the EU Sales list and the info will be there.

 

 

 

 

 


  
  
  
  
  
  
 
 
 

 

 

-

Troubleshooting Inplace Upgrade Script updateDirDartyRelationshipXDSLegalEntity()

$
0
0

You might recieve the following message when  running the upgrade script Classes\ReleaseUpdateDB62_GABMinor\updateDirDartyRelationshipXDSLegalEntity() during  an inplace upgrade from MS Dynamics AX 2012 R2 to R3:

“Cannot create a record in Party relationships (DirPartyRelationship). Invalid value specified for 'Expiration:'. It cannot be greater than or equal to the 'Expiration:' of the first record.”


One possible background could be unsufficient customer data quality in terms of partly missing data in the field “PartyID”
The following script is a slightly modified version of the standard script updateDirDartyRelationshipXDSLegalEntity(). It loops through the records sequentially instead of block wise and will list records where a PartyID might be missing:

“Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This blog post  assumes that you are familiar with the X++ programming language that is being demonstrated . Always test the script in test environments first in detail! ”


<<<<<<<
static void UpdateDirPartyRelationship_Test(Args _args)
{
#DirParty
HcmWorker worker;
HcmEmployment employment;
CompanyInfo companyInfo;
DirPartyRelationship partyRelationship;
DirRelationshipTypeId workerTypeId, applicantTypeId, partyInLETypeId;
utcdatetime validFrom = DateTimeUtil::minValue(), validTo = DateTimeUtil::maxValue();
DirDataAreaId systemDataAreaId = #SystemDataAreaId;

workerTypeId = DirRelationshipTypeTable::findBySystemType(DirSystemRelationshipType::Worker).RelationshipTypeId;
applicantTypeId = DirRelationshipTypeTable::findBySystemType(DirSystemRelationshipType::Applicant).RelationshipTypeId;
partyInLETypeId = DirRelationshipTypeTable::findBySystemType(DirSystemRelationshipType::PartyInLE).RelationshipTypeId;

partyRelationship.skipDatabaseLog(true);
partyRelationship.skipEvents(true);
partyRelationship.skipDataMethods(true);

info(strFmt("systemDataAreaId: ", systemDataAreaId));
info(strFmt("workerTypeId: ", workerTypeId));
info(strFmt("applicantTypeId: ", applicantTypeId));
info(strFmt("partyInLETypeId: ", partyInLETypeId));

ttsbegin;

// Delete all worker and applicant relationships
delete_from partyRelationship
where partyRelationship.RelationshipTypeId == workerTypeId ||
partyRelationship.RelationshipTypeId == applicantTypeId;

info("Finish deleting record in partyRelationship table");

// Insert worker relationships with employment record
/*insert_recordset
partyRelationship (RelationshipTypeId, ChildParty, ValidFrom, ValidTo, LegalEntityDataAreaId)
select workerTypeId, Person from worker
join ValidFrom, ValidTo from employment where employment.Worker == worker.RecId
join DataArea from companyInfo where companyInfo.RecId == employment.LegalEntity;*/

while select Person from worker
join ValidFrom, ValidTo from employment where employment.Worker == worker.RecId
join DataArea from companyInfo where companyInfo.RecId == employment.LegalEntity
{
  partyRelationship.clear();
  partyRelationship.RelationshipTypeId = workerTypeId;
  partyRelationship.ChildParty = worker.Person;
  partyRelationship.ValidFrom = employment.ValidFrom;
  partyRelationship.ValidTo = employment.ValidTo;
  partyRelationship.LegalEntityDataAreaId = companyInfo.DataArea;
try
{
partyRelationship.insert();
}
catch(Exception::DuplicateKeyException)
{
  error(strFmt("Duplicated key error on inserting HcmWorker record with recId %1 and relationship type %2 with Child Party %3",
  worker.RecId, workerTypeId, worker.Person));
}
  catch(Exception::UpdateConflict)
{
  error(strFmt("Update conflict error on inserting HcmWorker record with recId %1 and relationship type %2 with Child Party %3",
  worker.RecId, workerTypeId, worker.Person));
}
catch(Exception::Error)
{
  error(strFmt("Error on inserting HcmWorker record with recId %1 and relationship type %2 with Child Party %3",
  worker.RecId, workerTypeId, worker.Person));
}
}

info("Finish inserting worker relationships with employment record");

// Insert workers without employment records that does not existing party relationship
/*insert_recordset
partyRelationship (RelationshipTypeId, ChildParty, ValidFrom, ValidTo, LegalEntityDataAreaId)
select partyInLETypeId, Person, validFrom, validTo, systemDataAreaId from worker
notexists join employment
where employment.Worker == worker.RecId
notexists join partyRelationship
where partyRelationship.ChildParty == worker.Person &&
partyRelationship.LegalEntityDataAreaId == systemDataAreaId;*/

while select Person from worker
notexists join employment
where employment.Worker == worker.RecId
notexists join partyRelationship
where partyRelationship.ChildParty == worker.Person &&
partyRelationship.LegalEntityDataAreaId == systemDataAreaId
{
  partyRelationship.clear();
  partyRelationship.RelationshipTypeId = partyInLETypeId;
  partyRelationship.ChildParty = worker.Person;
  partyRelationship.ValidFrom = validFrom;
  partyRelationship.ValidTo = validTo;
  partyRelationship.LegalEntityDataAreaId = systemDataAreaId;
try
{
  partyRelationship.insert();
}
catch(Exception::DuplicateKeyException)
{
  error(strFmt("Duplicated key error on inserting HcmWorker record with recId %1 and relationship type %2 with Child Party %3",
  worker.RecId, partyInLETypeId, worker.Person));
}
catch(Exception::UpdateConflict)
{
  error(strFmt("Update conflict error on inserting HcmWorker record with recId %1 and relationship type %2 with Child Party %3",
  worker.RecId, partyInLETypeId, worker.Person));
}
  catch(Exception::Error)
{
  error(strFmt("Error on inserting HcmWorker record with recId %1 and relationship type %2 with Child Party %3",
  worker.RecId, partyInLETypeId, worker.Person));
}
}

info("Finish workers without employment records that does not existing party relationship");

ttsabort;

info("The script finishes without error!");
}
>>>>>>>

A few performance considerations for Multisite activation in MS Dynamics AX 2009 SP1

$
0
0

If you want to upgrade to any MS Dynamics AX 2012 version (R1, R2, or R3) from MS Dynamics AX 2009 then it is a needed requirement to run the multisite activation on the MS Dynamics AX 2009 side as a prerequisite.

The multisite activation process is known to be a quite performance intensive task!
Therefore I just like to recommend the following tips for the environment where you run the multi site activation:


Tips:

* Make sure that you run a distributed installation where the AOS server and SQL servers run on different computers

* Make sure that the AOS server and SQL server run 64 Bit Windows operating systems instead of 32 Bit Windows operating system due to enhanced main memory handling

* If possible prefer physical hardware for the AOS and SQL server instead of virtual machines if possible

* Check that “High Performance” under Control Panel, Power options is set for the AOS server, SQL server machine and AX client computer. You may find more information about the setup / background of the “High Performance” setting  here: http://blogs.msdn.com/b/axsupport/archive/2014/01/10/dynamics-ax-power-options.aspx 

* Make sure that the CPU clock speed of AOS and SQL server computer is >= 3 GHz


Addtional information:

You can find more application related  background information in the  MS Dynamics AX 2009 multisite activation white paper here:
http://www.microsoft.com/en-gb/download/details.aspx?id=12840

Some upgrade related information about MS Dynamics AX 2009 multisite activation can listed here:
http://blogs.msdn.com/b/axsupport/archive/2012/05/24/multisite-activation-within-the-upgrade-process.aspx

DIXF - Importing Data - How to use Auto-generated to import PartyNumber

$
0
0

Consider a scenario where you want to import data into AX 2012 R3 using DIXF, but you want a particular value to be auto-generated by the system rather than input from a text file. The following blog post aims to show how this can be done for a specific DIXF entity, so you have an example of this in action.

In the example below, I am working with the DMFOMOperatingUnitEntity demo data file (CSV - delimited) that ships with AX 2012 R3.

You can usually find this file here:

C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\DemoFiles\Delimited

In this example, I worked with two versions of the demo text file which I called:

OMOperatingUnitEntity1NoAuto.txt 

and

OMOperatingUnitEntity1WithAuto.txt.

The files I am working with look like this:

Please note that the file header column info and data may appear truncated - Check the real sample data file for the details

// Execution ID = DMFOMOperatingUnitEntity-1
// Input File = OMOperatingUnitEntity1NoAuto.txt

----------------------------------------------------------------------------------------CountryRegionId,Name,OMOperatingUnitNumber,Address,AddressEmail,AddressEmailName,AddressFax,AddressFaxName,AddressName,AddressPhone,AddressPhoneName,AddressTelex,AddressTelexName,AddressUrl,AddressUrlName,BuildingCompliment,CellularPhone,City,County,DistrictName,DunsNumber,Email,EmailName,FaxName,FirstName,Gender,HCMWorker_WorkerPartyName,HCMWorker_WorkerPartyNumber,HCMWorker_WorkerPersonnelNumber,KnownAs,LanguageId,LastName,Latitude,LocationRole,Longitude,MiddleName,NameAlias,OMOperatingUnitType,OrganizationType,Pager,PartyNumber,PartyType,Phone,PhoneLocal,PhoneName,PhoneticName,PostBox,SMS,State,Street,StreetNumber,TeleFax,TeleFaxName,Telex,TelexName,TimeZone,URL,UrlName,ValidFrom,ValidTo,ZipCode
USA,Admin,101,,test@import.com,E-mail
address,,,Import Address2,,,,,www.Import.com,Import
URL,,,Aguadilla,AGUADILLA,,,Test@import.com,Import
Email,,,,,,,,,,.0000000000000000,Business,.0000000000000000,,,Department,,,000002826,,4253212543,,Phone,,,,PR,,,,,,,0,,,,,00603
----------------------------------------------------------------------------------------

This is the default demo file for the entity and the hardcoded PartyNumber value has been highlighted in yellow

Please note that the file header column info and data may appear truncated - Check the real sample data file for the details

// Execution ID = DMFOMOperatingUnitEntityAuto-1
// Input File = OMOperatingUnitEntity1WithAuto.txt

----------------------------------------------------------------------------------------
CountryRegionId,Name,OMOperatingUnitNumber,Address,AddressEmail,AddressEmailName,AddressFax,AddressFaxName,AddressName,AddressPhone,AddressPhoneName,AddressTelex,AddressTelexName,AddressUrl,AddressUrlName,BuildingCompliment,CellularPhone,City,County,DistrictName,DunsNumber,Email,EmailName,FaxName,FirstName,Gender,HCMWorker_WorkerPartyName,HCMWorker_WorkerPartyNumber,HCMWorker_WorkerPersonnelNumber,KnownAs,LanguageId,LastName,Latitude,LocationRole,Longitude,MiddleName,NameAlias,OMOperatingUnitType,OrganizationType,Pager,PartyNumber,PartyType,Phone,PhoneLocal,PhoneName,PhoneticName,PostBox,SMS,State,Street,StreetNumber,TeleFax,TeleFaxName,Telex,TelexName,TimeZone,URL,UrlName,ValidFrom,ValidTo,ZipCode
USA,Admin,105,,test@import4.com,E-mail
address,,,Import Address6,,,,,www.Import.com,Import URL,,,San Juan,SAN
JUAN,,,Test@import.com,Import
Email,,,,,,,,,,.0000000000000000,Business,.0000000000000000,,,Department,,,,,4253212543,,Phone,,,,PR,,,,,,,0,,,,,00918
----------------------------------------------------------------------------------------

This is the default demo file for the entity and the hardcoded PartyNumber value removed (highlighted in yellow)

So, we now have one file with the hardcoded value in it and one with no value for PartyNumber in it.

1. The processing groups

Let's look at the Processing group where there are no changes to the entity setup and the PartyNumber is hardcoded in the input file.

When you've selected your entity and pointed it to your input file, you will see something like this when you click on Modify source mapping and then click on Mapping details:



If you click on Preview source file you will see that the value is in the input file:



Making the necessary change to use an auto-generated value is simple and only requires that you make a small modification to the source mapping:

Find the PartyNumber line and check the Auto-generated checkbox and you should see that the source field changes from PartyNumber to Auto:


If you click on Preview source file you will see that the value is at the end of the list of fields and reported as 1:



2. The results

Let's look at the data after the Processing groups have run OK and the data has been imported into staging:



You can use a similar approach with other entities if you want the system to auto-generate values.


Creating and managing custom indexes in Dynamics AX

$
0
0

Hello,

An index is a database structure that is used to speed the retrieval of information from a table, or in some cases to ensure the uniqueness of records in a table. In Dynamics AX, each table comes out-of-the-box with a variety of indexes designed to provide the best results in most cases. As every Dynamics AX implementation is different, every workload has its own specificity, there will be situations where you detect that a new index is necessary to improve the performance of a specific process.

In this article I will give you 10 recommendations to create and manage your custom indexes for Dynamics AX.

1- Limit the number of indexes per table, especially if the table is transactional or a table that is frequently updated. Adding an index can be beneficial for retrieving information from a table but SQL Server will have to update the new index every time a modification is done to the data in the table. You may speed up SELECT operations, but slow down INSERT, UPDATE and DELETE operations. Also, a new non-clustered index means a new object in the database. This object will need disk space. Having many indexes on a large table will have a big impact on the overall database size. 

2- Unit testing is not enough, do some integration testing and be prepared to rollback your change. The database indexes structure is a delicate and complex equilibrium and adding an index can have unexpected side effects. Make one change at a time and monitor the database to make sure your new index is not affecting other processes in a negative way.

3- Always create your custom indexes from the AOT, the columns PARTITION and DATAAREAID will be added when synchronizing if available. If you create your index directly from the database your changes may be lost at the next AOT synchronization.

4- Document why the index was created.

5- Check if the index is still required after an upgrade.

6- Include columns to improve the efficiency of your new index. You can do this from the AOT since version 2012. Including non-key columns to your index will allow SQL Server query optimizer to obtain all the columns needed, without having to access the clustered index or the table. These milliseconds gain can make a very big difference if the query is run thousands times inside a loop for example. Limit yourself to 4 or less included columns. Make sure there are static columns and not frequently updated columns. 

7- Remove custom indexes that are not used. Periodically review the indexes that are not used in your database. You can use Performance Analyzer for Microsoft Dynamics, or directly querying SQL Server DMVs. Remove only unused custom indexes, keep the unused standard ones. Be very careful when removing unused indexes as some of them are used infrequently, for example during end of month or end of year procedures. Make sure to have enough historical information before taking a decision.

8- Remove duplicate and included indexes. Indexes that are a left key subset of another index in the same table are not necessary unless there were created to ensure uniqueness.

9- Never include RECVERSION in an index, even as an included column, as this column is frequently updated.

10- Make sure your columns are in the correct order to avoid index scans.

Performance Analyzer for Microsoft Dynamics is the tool you need to manage your custom indexes in an efficient way.

 

I hope this is helpful!

Bertrand

 

How to manually produce an item at the time of a sales order

$
0
0

This content covers a business scenario of producing a sellable item at the time of sales order creation. This is a common practice in some companies where they sell a finished product, but do not keep any stock of it in the warehouse. In other words the finished product will be produced on demand.

The business scenario this is as follows:-

  1. A customer requests an item
  2. The sales order created for the finished “sellable” product
  3. Generate a production order linked to sales order to consume the raw material and produce the finished product.

 

 

In order to execute this process, create a sales order for finished goods “Bagged”, then go to Product and supply button and select Production order.

 

 

 

Create production order form will popup, press OK to create the production order.

 

 

In the production order go to Order details, and select BOM.

In the BOM form, enter the quantities which will be consumed from the Bulk item

 

 

Then press, Estimate, and End the production order.

 

Infolog indicate the consumption of bulk item, and produce the bagged item.

 

 

The on hand quantity of the bagged item are stocked in the warehouse and could be released from the sales order.

 

 

In the next blog post will cover the same business scenario with automation in production order creation.

 

 

 

 

How to produce an item at time of sales order if there is residual balance of the finished goods

$
0
0

I had published a blog post earlier this month which covered the process of how to produce an item at time of sales order. In this post I will cover another scenario where there is residual stock of bagged item in the warehouse, and there is a requirement to produce the difference from a production order. This could be handled byNet requirement functionality from the sales order line, which will fire a planned production order by the difference. After firming the planned production order the system will create a production order to produce the quantity.

The on-hand shows that the bagged item has physical inventory = 10 and the on order = 100 that is entered in a sales order line.

 

Ensure that there is a coverage group on the item setup, with planned order type Production.

Sales order with 100 ton.

Then go to Product and Supply, and select Net requirement.

 

Net requirement form

 

In the lower pane select Update| Master scheduling

Press OK

A planned production order will be created, and you can see the line on the net requirement

In order to Firm the planned production order, go to Production control| Common| Planned production order Ensure you filter on the same plan “DynPlan in my example”

 

After Firming the planned production order, it will create a production order to be ended to produce the required quantity = 90. And you can see the reference to the sales order and planned order as well.

 

Trade Allowance Management Blog Series – Trade Allowance Agreements for Lump Sum

$
0
0

In this blog, I will be discussing Trade Allowance Agreements and specifically the Lump Sum setup on the Trade Allowance Line.

 

A trade allowance is similar to a monetary reward where the customer is paid based on their performance during the promotion and sales of an agreed upon item.

Trade Allowance Agreement Header Setup

The trade allowance agreement form includes both a header and a line view. The header view contains fields which affect the entire agreement.

Trade allowance management > Common > Trade allowance agreements

Show > Header view

General Fast Tab:

Trade Allowance section:

Marketing objective: If the trade allowance is used to meet a marketing goal when promoting products, select the Marketing objective (Trade allowance management > Setup > Marketing objective)

Status:  Display the status of the trade promotion as it passes through different stages of approval.

  • In Process:  the trade promotion is in the process of being created
  • Management Approved:  management had decided to accept the details of the trade promotion
  • Customer Approved:   the customer has accepted the details of the trade promotion.  This is the status that makes the trade promotion active.
  • Closed:  a promotion has been completely executed and all payments have been authorized and approved.  No further activity can take place against this promotion

Date section:

The only required Date fields are the Order from and Order to.

Analysis section: 

The analysis subsection on the general fast tab contains key fields that define quantities and costs used for the promotion evaluation, quantities of products sold to the selected customers before the promotion is specified in the base unit field.  

The only required Analysis field is Unit.  All items on the trade allowance must match or convert to the unit selected. 

Calculated ship quantity is calculated based on the lift percent, which is a planned target increase for the promotion in question.  

Customers Fast Tab:

Hierarchy:  Select and view customer group setup as pre-defined hierarchies, and then pick the entire hierarchy or selected accounts as targets for the allowance agreement in question.

 

 

Items Fast Tab:

Add one or more items to the promotion based on the Hierarchy that is selected in the Add products form.

 

 

 

Funds Fast Tab:

Select the fund for the promotion.  In the Event cost allocation % field, enter the percentage of event costs that will be taken from the fund.

If multiple funds are specified, the total percent of all funds would add up to 100%.

 

Trade Allowance Agreement Line Setup

Trade allowance agreement lines are used to define the merchandising events.  Once the trade allowance goal and funds are defined, merchandising events can be designed and applied to the agreement.

 

Trade allowance management > Common > Trade allowance agreements

Show > Line view

General Fast Tab:

This is identical to the General tab entered on the trade promotion header and includes the Trade allowance and Dates section

Customer Fast Tab:

This is identical to the Customer tab entered on the trade promotion header 

Merchandising event Fast Tab

This is the amount to be paid when the terms of the trade promotion are met.

There are three different types of discounts that can be given on a trade promotion. The discount depends upon the category.

  • Lump Sum:   A promotion which requires the customer to perform a type of merchandising activity, such as a specific advertising campaign, putting up displays, etc. It is not based on incoming sales orders directly. When the requirements of the promotion have been met, a lump sum of money is given to the customer.
  • Bill back:  Throughout the life of this promotion, discounts will be calculated based on discount terms of incoming sales orders. At specific times, claims are generated to be approved for payment to the customer.   Reimbursement is given after purchase. 
  • Off invoice:   The discount is given during the pricing of an order that meets all of the promotion criteria. Taken at the time of order and automatically deducted before the customer makes a payment.  No Reimbursement necessary.

 

Lump Sum

Lump sum merchandising events are meant to be paid after services are rendered.  Below is an example of a Lump Sum Scenario:

A vendor requests that one of its suppliers runs an ad for a specific product.  The goal is to increase sales on the product.

The customer approves the proposed lump sum reimbursement for providing advertising services.  The ad runs and is provided to the vendor.  The vendor authorizes for services rendered, and the agreed lump sum is reimbursed to the supplier.  

On the Trade Allowance there is a Fund setup to pay a lump sum of 2,000.00 to Desert Wholesales for promoting item D0001.

Fund is setup with a Budget of 2,000, Customer Desert Wholesale, and item MidRangeSpeaker

The Trade Allowance Agreement is for 4/1/2015 – 7/1/2015

Customer:  Desert Wholesale

Item:  MidRangeSpeaker

Select Share>Line View to add the Lump Sum

 

The Item and Funds tab at the bottom will default information from the Header view.

Select the Amounts tab to add the Merchandise cost

 

Payment Type

Pay Using Accounts payable will create vendor invoices.  In this case, you have to enter a vendor account into the pay-to field.  

Customer deductions will credit the customer's account.  In this case, you have to select a customer account in the pay-to field.  Used when claims are to be paid to a Sell-to customer, i.e. the Order Account

Invoice customer deductions will credit the Invoice customer assigned to the customer (Customer Invoice and Delivery fast tab).  You have to select a customer account in the pay-to field.  Used when claims are to be paid to the Bill-to customer, i.e. the Invoice Account for the Customer

In this example, I will select Customer Deductions and select customer Desert Wholesale.

Note, the Status field is greyed out.  In order to change the Status, you must click Confirmed in the Header.

Once Confirmed, the Approve button will be available

Once the service is complete, click the Approve button and a message will ask about creating the Lump sum as an invoice for payment.

Click Yes

During the deduct phase, a free text invoice is created with a negative amount.  The invoice is registered as a deduction.  

An Infolog will display stating that the invoice has been posted for the lump sum.

Check to see that the Free Text Invoice was created for the Lump Sum

Accounts receivable > Common > Free Text Invoices > All Free Text Invoices

 

Select the Free Text Invoice that was created and expand the Line details Fast Tab to verify the Invoice Text field is populated with Lump sum claim.  The amount is -1,000.00 and you can see the Subledger credits the Customer balance and debits the Customer revenue.  The Customer revenue account
defaults from Trade Allowance parameters for the Lump Sum Expense Account.

In Customer Transactions for Desert Wholesale, you can see that the Credit Memo Voucher (Deduction) was created.  The Deduction can be used later for matching when the customer deducts amounts from their payments.

Trade Allowance Management Blog Series – Trade Allowance Agreements for Bill Back

$
0
0

In this blog, I will be discussing Trade Allowance Agreements and specifically the Bill Back setup on the Trade Allowance Line.

 

See the link below for information on setting up the Trade Allowance Header and Trade Allowance Line:

http://blogs.msdn.com/b/axsupport/archive/2015/10/27/trade-allowance-management-blog-series-trade-allowance-agreements-for-lump-sum.aspx

 

Bill-back merchandising events are used for trade allowances where reimbursement is given after purchase.  One advantage to the bill-back option is the ability to select at what point during the purchasing process the customer will be reimbursed.  This is also complimented by the accrual nature of such reimbursements.  One customer may purchase the same item various times during the promotion, but the company has the ability to limit the interval at which it pays bill-back reimbursements.  

Bill backs are a slightly more complicated process and include two separate postings.  Once a sales order with a corresponding bill back trade allowance is entered, the sales clerk can see that a bill back from a valid trade allowance agreement is on the details form, in the rebate amounts fields in the margin estimations section.  Once a sales invoice is posted, the corresponding bill back claims are generated for each invoice line.  

Below is an example of a Bill Back Scenario:

A cell phone model is released.  It is more expensive than the preceding model of the same phone since it has the latest technology.
In order to encourage customers to buy newer model, your company is offering a bill-back trade allowance of $50 for each phone purchased for all ordered quantities between 1 and 5 and 100.00 for all ordered quantities between 6 and 15.  

In this example, the customer can collect their $50 when they order the phone.

On the Trade Allowance there is a Fund setup to pay a lump sum of 10,000.00 to Sparrow Retail for promoting item D0002.

Fund is setup with a Budget of 2,000, Customer Desert Wholesale, and item Litware Mobile Phones SAW M806.

The Trade Allowance Agreement is for 4/1/2015 – 7/1/2015

Customer:  Sparrow Retail

Item:  Litware Mobile Phones SAW M806.

 

Select Show >Line View to add the Bill Back

 

The Item and Funds tab at the bottom will default information from the Header view.

Select the Amounts tab to add the Merchandise cost

The Amounts tab looks very different from the Lump Sum.  There is an Identification section and a Trade Allowance Lines section.

 

Calculation date type:

                Created– Eligible for the rebate when the item is ordered

                Requested receipt– Eligible for the rebate when the item is received

                Requested ship– Eligible for the rebate when the item is shipped.

Unit of measure rebate option: Convert or exact match

Unit type:  Inventory unit or Catch weight unit

Unit:  Unit of measure the rebates are stored in.

Rebate line break type:  Select if the tiered rebate is based on Quantity or Amount.

Cumulate sales by:  Month (That way the customer can be eligible for as many purchases as they make in a month).

Payment Type:  The same options as Lump Sum are available.  I will select Customer Deduction.

Rebate program ID:  This is setup in Sales and Marketing > Common > Rebate program > Rebate program types. 

The Rebate program ID defaults from Trade allowance parameters and the Default accrual and Default expense account default from the Rebate program type.

Trade allowance lines contains the detail about the rebate.

Amount type:  Select Amount per unit, Fixed amount, or Percentage.  In this example we will use Amount per unit.

Enter From qty 1 and To qty 5 for our first tier and 50.00 rebate value.

Enter From qty 6 and To qty 15 for our second tier and 100.00 rebate value.

 

If Approval is required, you must click Internal Approved.  Click Confirmed in the Action Pane. 

With the Bill Back you must create the Sales order first and depending on the status of the sales order, the customer will be eligible for the rebate (in this example the customer is eligible when ordered).

 

Create a new sales order

Sales and marketing or Accounts Receivable > Common > Sales orders > All Sales orders

Create a new Sales order for Sparrow Retail (US-008) and add item Litware Mobile Phones SAW M806 (5306) with a quantity of 2.  Add a second line with a quantity of 4.

Select each line and select Sales order line > View > Price details

Expand Rebates.

For the line with a quantity of 2, you see $100.

2 falls within the first tier of $50 rebate per unit.

For the line with a quantity of 4, you see $200.

4 falls within the first tier of $50 rebate per unit.

Invoice the sales order so the item will display in the Bill Back Workbenc

Trade allowance management > Common > Bill Back Workbench

Both of the lines should display with the same amount as was displayed in the Rebate tab of the Price details form above.

 

Cumulate the Rebates:

For most rebates, the first step in processing after invoicing the sales order is to cumulate.  This will sum up the rebate amount during the rebate calculation.  The exception to this rule is when the invoice method is selected.  When using the invoice method, there is nothing to cumulate because each sales order invoice will have its own claim and the status will automatically be calculated.  

The quantity of each of the claimed sales invoice line falls into the agreement's first quantity break of 1 to 5 (2 and 4) and the customer received the $50 bill back ($300 total).  Because the customer purchased 6 units of televisions within a month, they are entitled to a bigger bill-back, i.e., 100 USD per unit ($600 total) as specified by the second quantity break (6-15).  The claims, therefore, have to be recalculated in order to account for any cumulative effect.  

This will change the Rebates to calculated

 

Approve the Rebates:

After cumulating the rebate claims, you can approve them for further processing

 

Process the Rebate:

You processed the approved rebates to post on the interim accounts

 

Once processed the status will change to Mark and the Infolog will show the vouchers that have posted.  The claims have now been transferred to the temporary customer balance as deductions.


 

The rebate accrual account has been credited to represent the future liability towards the customer.  

The rebate expense account has been debited in recognition of the cost incurred in connection with the sales.  

 Sales and marketing > Common > Customers > All customers or

Accounts receivable > Common > Customers > All customers

 

Find customer US-008 (Sparrow Retail).  Once highlighting this customer, click collect, settle open transactions.  

In the Settle open transactions form, select Functions > Bill back program

To create the credit note mark the Rebates, click Functions > Create credit note

The number of vouchers posted to the journal is one.  

Go back to trade allowance management to look at the bill-back workbench and verify that our claims were set to Completed.  

Financially, this implies that the customer's receivable account has been credited, and the rebate accrual account has been debited.  

Note that a transaction for a negative amount of $600.00 without invoice reference has been added to the customer balance.    

Voucher:

When paying the customer’s invoice, you can use the credit note to offset the invoice.

In the Payment Journal select Functions > Settlement

Mark the Sales invoice and the credit note and click Close

 

 

Purge Bill backs:

You can delete all rebates with a status of mark or completed by using the rebate purge form.  However, recognize that purging rebates will not make any entries to the general ledger.  If a liability is created in the general ledger when the rebate is recorded, it must be reversed manually.  

In the Bill back workbench, select the Purge function.

The Rebate purge window will allow you to purge up to a certain date.

 

 

The Bill backs will be removed from the Bill back workbench

 

Viewing all 475 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>