Dynamics Search Engine

Showing posts with label AX 2012 Error. Show all posts
Showing posts with label AX 2012 Error. Show all posts

Thursday, May 26, 2016

In Microsoft Dynamics AX 2012 how to get account lookup based on Ledger Account type, Bank Account type, Customer Account type, Vendor Account type etc.

This article explains about:
·         In Microsoft Dynamics AX 2012 how to get account lookup based on account type.
·         In Microsoft Dynamics AX 2012 how to get account lookup based on Ledger Account type, Bank Account type, Customer Account type, Vendor Account type etc.

Applied on: Dynamics AX 2012 R3 CU8.
Prerequisite: Basic Dynamics AX 2012 programming knowledge.
Target audience: AX programmers.
Assumption: You are familiar with Dynamics AX 2012.

In Microsoft Dynamics AX 2012 Account lookup works in a different way because dimension structure change in comparison with Microsoft Dynamics AX 2009.

Below are some screenshots which give an idea what output we are going to achieve.

A new table created with two fields e.g. Account type (LedgerJournalACType) and Account (LedgerDimensionAccount). The relation comes with the EDT when you drag and drop the EDT to this table fields to create a new field.










Sample output of Ledger account type. When you select Ledger it gives the segment option as well.
















Sample output of Customer account type.







A new form created with two fields e.g. Account type and Account. These are bound fields. Above table has been used as data source for this form. Field Account (LedgerDimensionAccount) at form data source has two methods called jumpRef() and resolveReference().





























JumpRef() code:
public void jumpRef()
{
    dimOnlinePaymController.jumpRef();
}

ResolveReference() code:
public Common resolveReference(FormReferenceControl _formReferenceControl)
{
    Common common = dimOnlinePaymController.resolveReference();

    return common;
}

We have few more methods at form control level. For Account field as control we need to take a segment entity control which should be bounded to data source field called LedgerDimensionAccount. You can get this control by right click on form design or field group or wherever you want.
On below screenshot we have a segment entry control and it has 6 methods. Code for all these methods I mentioned here in this article. The auto declare property of this control is set to Yes.
























Declaration at form level:
public class FormRun extends ObjectRun
{
    DimensionDynamicAccountController   dimOnlinePaymController;
}

Form init():
public void init()
{
    super();
   
    dimOnlinePaymController = DimensionDynamicAccountController::construct(RBAccountTypeLookup_DS, fieldStr(RBAccountTypeLookup, LedgerDimensionAccount), fieldStr(RBAccountTypeLookup, LedgerJournalACType));
    dimOnlinePaymController.parmIsDefaultAccount(true);
   
}

Method at form control level:
public void jumpRef()
{
    dimOnlinePaymController.jumpRef();
}

public Common resolveReference(FormReferenceControl _formReferenceControl)
{
    Common common = dimOnlinePaymController.resolveReference();

    return common;
}


Method at form control level:
public void jumpRef()
{
    dimOnlinePaymController.jumpRef();
}


Method at form control level:
public void loadAutoCompleteData(LoadAutoCompleteDataEventArgs _e)
{
    super(_e);

    dimOnlinePaymController.loadAutoCompleteData(_e);
}


Method at form control level:
public void loadSegments()
{
    super();

    dimOnlinePaymController.parmControl(this);
    dimOnlinePaymController.loadSegments();
}


Method at form control level:
public void lookup()
{
    switch (RBAccountTypeLookup.LedgerJournalACType)
    {
        case LedgerJournalACType::Bank:
            BankAccountTable::lookupBankAccount(this);
            break;
        case LedgerJournalACType::Cust:
            CustTable::lookupCustomer(this);
            break;
        case LedgerJournalACType::FixedAssets:
            AssetTable::lookupAccountNum(this);
            break;
        case LedgerJournalACType::Ledger:
            super();
            break;
        case LedgerJournalACType::Vend:
            VendTable::lookupVendor(this);
            break;
        default:
            super();
            break;
    }
}

Method at form control level:
public void segmentValueChanged(SegmentValueChangedEventArgs _e)
{
    super(_e);

    dimOnlinePaymController.segmentValueChanged(_e);
}


Method at form control level:

public boolean validate()
{
    boolean isValid;

    isValid = super();
    isValid = dimOnlinePaymController.validate() && isValid;

    return isValid;
}


Save your work and try to run the form.
The above code is available in Microsoft Dynamics AX 2012. Only thing I did is assembled the required code here to make is handy.

Hope this was useful for you. Feel free to leave your comments below.

Tuesday, February 24, 2015

How to fix Data Migration Framework (DIXF) error in Microsoft Dynamics AX 2012 R3

How to fix Data Migration Framework (DIXF) error in Microsoft Dynamics AX 2012 R3

 
This article addresses:
How to resolve Data Import / Export Framework (DIXF) error.
How to resolve data upload error in Microsoft Dynamics AX 2012.
How to resolve error ‘could not load file or assembly … The system cannot find the file specified.




Applied on: Dynamics AX 2012 R3.
Prerequisite: Basic Dynamics AX 2012 programming knowledge.
Target audience: AX programmers.
Assumption: You are familiar with Dynamics AX 2012.

When you get an error to upload data using Data Migration Framework (DIXF), check below things.

- Data Import / Export Framework (DIXF) service should be installed on a computer running SQL Server Integration Services. This component provides the connection to SQL Server Integration Services.
In order to complete the installation, you must provide an account for the service to run as. AOS service account is recommended.
 

- AOS component should be installed on AOS server that connects the AOS to the Data Import/Export Framework service. If AOS component is installed correctly you should get a folder called  DataImportExportFramework under default location “C:\Program Files\Microsoft Dynamics AX\60” on AOS server. Inside this folder you should have:

DMFConfig
Microsoft.Dynamics.AX.Framework.Tools.DMF.DriverHelper
Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelper
Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService
Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe


- Client component should be installed on client system. It installs the user interface component of the Data Import/Export Framework. If client component is installed correctly the client bin folder should have 4 DLLs e.g.

Microsoft.Dynamics.AX.Framework.Tools.DMF.DriverHelper.dll, Microsoft.Dynamics.AX.Framework.Tools.DMF.Mapper.dll, Microsoft.Dynamics.AX.Framework.Tools.DMF.PreviewGrid.dll, Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.dll

The default location for these files is “C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin” on client machine. Your AOS server can be a client as well.
 

-     Open your AX client and go to Data import export framework module > Setup > Data import/export framework parameters. On this form you need to define a share folder path and validate. Important thing is the service account assigned to Data Import / Export Framework (DIXF) service on SQL server should have access to this folder.

 

-      On AOS server go to Start > Administrative Tools > Server Manager > Configuration > Local Users and Groups > Groups. In this Groups folder there must a group called Microsoft Dynamics AX Data Import Export Framework Service Users. In this group add service account (user ID) which you used for DIXF on SQL server. Also add users will be accessing DIXF.
 

-      Open your AX client and go to System administration > Setup > Services and Application Integration Framework > Inbound ports > make sure DMFService is activated.

 
Hope this was useful for you. Leave your comment below

Sunday, January 11, 2015

How to fix error Invalid object name tempdb.DBO and TRUNCATE TABLE tempdb. DBO in Microsoft Dynamics AX 2012

How to fix error Invalid object name tempdb.DBO and TRUNCATE TABLE tempdb. DBO in Microsoft Dynamics AX 2012.

This article explain how to resolve tempdb.DBO error and TRUNCATE TABLE tempdb. DBO when you do a posting in Microsoft Dynamics AX 2012

Applied on: Dynamics AX 2012 R3

Error:
SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'tempdb.DBO.t20143_ADF272F84AED47BF8B58C5DF75F56229'.

SQL statement: TRUNCATE TABLE tempdb."DBO".t20143_ADF272F84AED47BF8B58C5DF75F56229

Symptom:
Sometimes when you do posting in Microsoft Dynamics AX 2012 it throws an error which says like [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'tempdb.DBO.t20143_ADF272F84AED47BF8B58C5DF75F56229 also says SQL statement: TRUNCATE TABLE tempdb."DBO".t20143_ADF272F84AED47BF8B58C5DF75F56229.

Sample screenshot:


 
 
 
 
 
 
 

 
 
 
 
Resolution:
Solution is to restart the AOS.


 

Tuesday, February 25, 2014

How to resolve CIL problem when it says Cannot create a record in SysXppAssembly (SysXppAssembly). The record already exists.

How to resolve CIL problem when it says Cannot create a record in SysXppAssembly (SysXppAssembly). The record already exists.

Sometimes you try to general incremental CIL or full CIL and receive error like "Cannot create a record in SysXppAssembly (SysXppAssembly). The record already exists." as shown below.



How to get out of this error?

The solution is simple. You need to restart the AOS.

Applied on: Dynamics AX 2012 R2
Prerequisite: Basic Dynamics AX 2012 knowledge

Target audience: AX programmers
Assumption: You are familiar with Dynamics AX 2012

Hope this was useful. You may leave your comments below.



 

Friday, February 21, 2014

How to resolve error Disconnected from the AOS for Microsoft Dynamics AX 2012 and Visual Studio .Net

Why you get error "Disconnected from the AOS" when you open Visual Studio and try to see Application Explorer tool box to customize something for Microsoft Dynamics AX Enterprise Portal or SSRS Reports?




Reason:

The Visual Studio instance you open does not refer the configuration which is configured. Such error you will encounter when you have different client and AOS system. For example; Server 1 is having Application Object Server (AOS) and System 1 is having AX client so you have AX client and server on different machines. Other way your Visual Studio instance is not connected to target Microsoft Dynamics AX AOS configuration.

Applied on: Dynamics AX 2012 R2

Prerequisite: Basic Dynamics AX 2012 knowledge
Target audience: AX programmers
Assumption: You are familiar with Dynamics AX 2012 and Visual Studio .Net


Solution:
Option 1: You should have AX client and server on the same machine. In general development server with multi users is not configured with single machine based.

Option 2: If your AX client and server are on different machines, you need to launch your Visual Studio instance using a shortcut from AX client machine and that shortcut should have target AOS configuration. E.g. You have an AX configuration file called VAR_DEV.AXC to launch the correct AOS. Get a shortcut of your Visual Studio on AX client machine right click on it. You will see the property dialog as shown below.


 

You will see the Visual Studio instance common IDE path [see above]. This is the default path. The depends based on installation.

The Target field should have path "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe". This is the default path.

The action you need to perform is to add target for AOS configuration file to it. To achieve this replace the path with "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /AXConfig \\[File location]\DEV04_VAR.AXC


After modifying this value click on Apply button. Now you launch your Visual Studio by double clicking this Visual Studio Icon. It will allow you to see AOT objects as shown below.
 
 


Option 3: On AX client machine configuration utility you can upload configuration file DEV04_VAR.AXC. To do this, open Microsoft Dynamics AX 2012 Configuration Utility from Administrative Tools. Click on Manage button then Set Configuration Stone.



Click on Apply button then OK.

Now you can launch your Visual Studio on AX client machine from Start button > All Programs > Microsoft Visual Studio 2010 folder > Microsoft Visual Studio 2010.



Hope this was useful for you. You may leave your comments below.

 

Monday, October 29, 2012

How to fix Best Practice error The Table.Field does not have a corresponding parm-method on the AxBC-class


How to fix Best Practice error The Table.Field does not have a corresponding parm-method on the AxBC-class

Applied on:
Microsoft Dynamics® AX 2012 Fpk.

Assumption:
This article is for those who has at least basic and programming
knowledge of Dynamics® AX.

About this article:
how to fix Best Practice error The Table.Field does not have a corresponding parm-method on the AxBC-class  when you create new field for existing table. E.g. InventTable, PurchTable, SalesTable etc.
BP Deviation for The Table.Field does not have a corresponding parm-method on the AxBC-class due to new field creation for tables. 

There are number of ways to achieve this. As per my view the easiest way is to execute a job. A sample job is mentioned below.

static void CreateAxBCParmMethod(Args _args)
{
    axGenerateAxBCClass axGenerateAxBCClass;

    axGenerateAxBCClass = AxGenerateAxBCClass::newTableId(tablenum(InventTable));
    axGenerateAxBCClass.run();

}

In the above job you can replace the table name instead of InventTable to create parm method as per your requirement.
The above job will generate method against new field created for InventTable.
Hope this article is useful.

 

Friday, May 11, 2012

Microsoft Dynamics AX 2012 Cubes or Role center BI report error

Microsoft Dynamics AX 2012 Cubes or Role center BI report error.

In Microsoft Dynamics AX 2012 you might face problem with BI reports for role center or reports where Cubes are involve.

There can be number of reasons for this and you will get number of errors. Like permission not granted, access denied, related data missing, cubes not processed etc.

Two main reasons are (1) data missing in respective tables and (2) insufficient license.

In most of the places data is interrelated among the tables. If you are missing related data in tables, it will give some errors.

Secondly, by default Microsoft provides cubes for all the tables and assumption is you have 100% license. But when there is a limited license and you apply it to your application, based on limited license system drops few tables for which you do not have license. In such a scenario your queries for cubes are not updated and they are still using 100% tables but you don’t have 100% tables now because of limited license.

Here the option for you is to update the queries but it’s a huge task. For Microsoft Dynamics AX 2009 you have to do it manually but to help you Microsoft published a tool to generate an excel sheet which tells you what are the areas you need to work.
In case of Dynamics AX 2012, Microsoft provided few options in the form of a wizard from where you can do it by clicking a button as shown below:
Path: Tools Business Intelligence (BI) Tools  SQL Server Analysis Services project wizard.

In the above wizard if you select Update option and follow the wizard it resolve your problem.

Tuesday, February 21, 2012

In Microsoft Dynamics AX 2012 during data import using Excel Add-Ins you may experience an exception or error

In Microsoft Dynamics AX 2012 during data import using Excel Add-Ins you may experience an exception like: “You must include at least two items in any list used for updating data.”

Applied on:
Microsoft Dynamics AX 2012 CU2.

Assumption:
This article is for those who has at least basic data flow and navigation
knowledge.

About this article:
This article may answers your question like-
• In Microsoft Dynamics AX 2012 how to handle exception during data import or data conversion?
• In Microsoft Dynamics AX 2012 how to copy master data from one environment to another environment and handle exception or error?
• In Microsoft Dynamics AX 2012 what are the new feature to export / import data?

Exception:

Resolution:
During data import using Excel Add-ins tool you need to select table(s). Once the table(s) is selected, by default system will select field(s) from table which is mandatory or part of primary index. If you have more than two fields like this then you will not face this exception or error. If there is one field which is mandatory or part of primary index in your table then system will select that field and put in the excel sheet and manually you need to select one more field along with this. In the above error screen if you see the red marked area where one more field to be added to get out of this exception.
Hope this is useful.

Tuesday, December 20, 2011

Data import error in Microsoft Dynamics AX 2012 using Dynamics AX Add-ins for Microsoft Office Excel

This article explains:
How to resolve data import error for Microsoft Dynamics AX 2012 using Office Add-ins. This error happens when you try to import data from excel to Dynamics AX.

Applied on:
Microsoft Dynamics AX 2012 CU2.

Symptom:
When you try to import data for LogisticsAddressCity, LogisticsAddressZipCode, LogisticsAddressState etc. you get an error “Cannot load [LogisticsAddressCity]. Tables must have a valid replacement key or a primary index other than RecID for use in Office Add-ins”.




Reason:
The main reason of this error is missing of primary index which is responsible for unique record in your table.

Solution:
Step 1
: Open your AX client and go the AOT / Data Dictionary / Tables then LogisticsAddressCity table.
Step 2: Go the indexes of above mentioned table and create a new index.
Step 3: Assign fields CountryRegionId, Name and RecId to this new index. Save your work. Here CountryRegionId and Name both are mandatory fields for this table so added in primary index and additionally RecId has been added to make the record unique in the table.
Step 4: Select newly created index and go to property of the index. Set property for Allow Duplicates = No; Alternate Key = Yes
Step 5: Save your work and select table LogisticsAddresssCity. Go to property of this table and set newly created index to Replacement Key property. Save your work.

Please repeat step 2 to 5 for other tables you got error. Select mandatory fields and RecId in their index.
Step 6: Right click on these tables and synchronize them one by one.
Step 7: Select all these customized tables and generate CIL. You can use Ctrl + Shift + F7 to generate CIL for selected tables. If CIL is generated correctly you will get output messages like: Finished Pass 1 at [date & time], Finished Pass 2 at [date & time], Finished Pass 3 at [date & time].
Step 8: Once all these are done, restart your application AOS. Once the AOS is restarted, run your AX client and try to import data.



Hope this will resolve your problem.
Happy learning :)


NOTE: Use at your own risk. There is no warranty on this article.