Wednesday, 22 April 2015

Error While Activating The Inbound Port In AX2012 R2



                             


Solution :
Stop AOS
Delete all files from XPPIL folder
Start AOS
Full compile the Dynamics AX application object (Should have zero error)
perform full CIL compilation
I hope this will solve your problem

AX2012 R3 CU8 – AOT Compile Errors on Payroll Classes related to Symmetry DLL

Event Log:

The error we received in the event log was:
“The description for Event ID 110 from source Microsoft Dynamics AX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Microsoft Dynamics AX Business Connector Session 7.
Failed loading assembly ste-net, Version=1.0.1.74, Culture=neutral, PublicKeyToken=5542884f620dbde5″

Compiler output:

SeverityPathLineColError message
Error\Classes\PayrollCalculatePayStatementBenefits\classDeclaration125Syntax error.
Error\Classes\PayrollCalculatePayStatementTaxes\classDeclaration425Syntax error.
Error\Classes\PayrollSetup\refreshWorkerTaxRegionTaxes255Variable Symmetry has not been declared.
Error\Classes\PayrollTaxCalculation\classDeclaration75Syntax error.
Error\Classes\PayrollTaxEngineUtil\checkInTaxEngine737Syntax error.
Error\Classes\PayrollTaxEngineUtil\checkOutTaxEngine715Syntax error.
Error\Classes\PayrollTaxEngineUtil\getGNISLocations405Variable Symmetry has not been declared.
Error\Classes\PayrollTaxEngineUtil\getMunicipalities395Variable Symmetry has not been declared.
Error\Classes\PayrollTaxEngineUtil\getPoliticalSubDivision315Syntax error.
Error\Classes\PayrollTaxEngineUtil\getPoliticalSubDivisionByTaxCode205Syntax error.
Error\Classes\PayrollTaxEngineUtil\getSchoolDistricts415Variable Symmetry has not been declared.
Error\Classes\PayrollTaxEngineUtil\getTaxEngineLocationCodeList385Variable Symmetry has not been declared.
Error\Classes\PayrollTaxEngineUtil\getTaxEngineVersion1039Syntax error.
Error\Classes\PayrollTaxEngineUtil\getTaxTableVersion1038Syntax error.
Error\Classes\PayrollTaxEngineUtil\money2Real1140Syntax error.
Error\Classes\PayrollTaxEngineUtil\real2Hours1122Syntax error.
Error\Classes\PayrollTaxEngineUtil\real2Money1122Syntax error.
Error\Classes\PayrollTaxEngineUtil\real2Rate1122Syntax error.
Error\Classes\PayrollTaxEngineUtil\taxCalculation2TaxCode1162Syntax error.
Error\Classes\PayrollTaxTypeInitialization\classDeclaration85Syntax error.
Error\Data Dictionary\Tables\PayrollEmployerTaxRegion\Methods\retrieveGNIS125Variable Symmetry has not been declared.
Error\Data Dictionary\Tables\PrlTmpGNIS\Methods\populatePrlTmpGNIS135Variable Symmetry has not been declared.

Example Code containing error:

Symmetry.TaxEngine.BenefitInfo benefitInfo401_403;”
“Symmetry.TaxEngine.STEPayrollCalculator             ste;”
“Symmetry.TaxEngine.STEPayrollCalculator             ste;”

Solution:

On AOT\Reference node, add again the library ste-net.dll

You can find on C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin folder.

Tuesday, 21 April 2015

AX2012 AXUTIL commands to Import,Export,Delete Models

// creating the Model in the Layer
AxUtil create /model:"TestModel" /Layer:CUS

// exporting the model to file
AxUtil export /model:"TestModel" /file:TestModel.axmodel

// importing the model from file
AxUtil import /file:TestModel.axmodel

// delete the model
AxUtil delete /model:"TestModel"

//delete the layer
AxUtil delete /layer:ISV

// if you have multiple instances running
//delete the layer from the database and AXserver.
Axutil delete /layer:ISV /db:<database> /s:<server>

Model and Model Store in ax 2012

Basic Info:

Models were introduced in Microsoft Dynamics AX to help partners and customers more easily install and maintain multiple solutions side by side in the same layer. This topic introduces the concept of models, and describes how models relate to layers and label files. This topic also describes the model store, which is the part of the Microsoft Dynamics AX database in which models are stored.
Models:
model is a set of elements in a given layer. Each layer consists of one or more models. Each layer contains one system-generated model that is specific to that layer. Every element in a layer belongs to only one model. In other words, no element can belong to two models in the same layer, and every element must belong to a model.
A model is permanently associated with the layer that is created in. If you need to move one of your models from one layer to another, you must create a project from the model in the AOT, export the project as an xpo file, create a target model in the desired layer, delete the original model to avoid having to resolve layer conflicts, and import the xpo file to the target model. If you are moving elements between models in the same layer, you can use the Move to model command in the AOT.
ModelStore:
Models are stored in the model store. The model store is the part of the Microsoft Dynamics AX database in which all application elements for Microsoft Dynamics AX are stored. Customizations are also stored in the model store. The model store replaces the Application Object Data (AOD) files that were used in earlier versions of Microsoft Dynamics AX. Models that have been installed in the model store are used at run time.
Note: Models can be exported to files that have the .axmodel extension. These files are called model files. Model files are deployment artifacts. Model files can be signed with strong name signing and Microsoft Authenticode signing.
How to manage Label files with Model:
In Microsoft Dynamics AX 2012, label files, or ALD files, are part of models. A label file must be added to a model before the model can be installed. After a model has been installed, ALD files are pulled from the model store to the local of Application Object Server (AOS) instance when the AOS is started. When the AOS is shut down, the ALD files are pushed back to the model store.
ALD files from earlier versions of Microsoft Dynamics AX are not part of a model file. However, you can import these files into the model store from the Label Files section of the Application Object Tree (AOT). Use the Create from file shortcut command.
Note: The ALD file from an earlier version of Microsoft Dynamics AX must not be located in the application folder of AOS. Otherwise, you cannot import the file.

Working with label files across solutions

It is recommend that you use one label file per solution to simplify installation.
If you find that you require multiple label files, it is recommend that you create a single shared, cross-solution label file and package it as a model file. Then, when you install solutions, you must install two models: the solution itself and the label model.
If you want to ship additional languages, you can add the languages to the solution model, increment the model’s version number, and then re-import the model.

Export an .axmodel file (Windows PowerShell)

  1. On the Start menu, point to All Programs, point to Administrative Tools, and then click Microsoft Dynamics AX Management Shell.
  2. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.
    Export Command Syntax :
    Export-AXModel –Model <name> -File <Filename.axmodel>
    Example :
    Export-AXModel –Model SecurityModel -File C:\SecurityModel.axmodel
Import an .axmodel file (Windows PowerShell)
    1. On the Start menu, point to All Programs, point to Administrative Tools, and then click Microsoft Dynamics AX Management Shell.
    2. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.
    Import Command Syntax :
    Install-AXModel -File <Filename.axmodel> -Details
    Exmaple :
    Install-AXModel -File C:\SecurityModel.axmodel -Details
Exporting a Model with AXUtil.exe
To export a model by using AXUtil.exe follow these steps.
  1. Click Start > All Programs > Accessories and right-click Command Prompt selecting Run as administrator.
  2. Change directory to “\Program Files\Microsoft DynamicsAX\60\Server\MicrosoftDynamicsAX\Bin” or to the bin directory for your server installation.
  3. Type “AxUtil.exe export/file:<path to save your model>.axmodel/model:<model name>” and then press Enter to export the model.
Importing a Model with AXUtil.exe
To import a model by using AXUtil.exe follow these steps.
  1. Click Start > All Programs > Accessories and right-click Command Prompt selecting Run as administrator.
  2. Change directory to “\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin” or to the bin directory for your server installation.
  3. Type “AxUtil.exe import /file:<path to where you saved your model>.axmodel and then pressEnter to import the model.
The model store that you export remains in the original environment. The model store is not deleted.

Export a model store (Windows PowerShell)

  1. On the Start menu, point to All Programs, point to Administrative Tools, and then click Microsoft Dynamics AX Management Shell.
  2. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.
    Export-AXModelStore -File <Filename> -Details
    
    This command exports the model store to an .axmodelstore file.
    For more information, see Export-AXModelStore.

Export a model store (AXUtil)

  1. On the Start menu, click Command prompt.
  2. Navigate to the directory for the management utilities. Typically, the location of this directory is %ProgramFiles%\Microsoft Dynamics AX\60\ManagementUtilities.
  3. At the command prompt, type the following command, and then press ENTER.
    axutil exportstore /file:filename [/verbose]
    
    This command exports the model store to an .axmodelstore file.
When you import a model store, you can import the new model store directly to the default schema, dbo. Alternatively, you can import the model store to a different schema, and then apply the model store to the default schema.
  • If you import the new model store directly to the dbo schema, downtime is likely to be greater, because you must stop all Application Object Server (AOS) instances while the model store is imported.
  • If you import the model store file to a non-default schema, downtime may be less, because AOS instances can remain active throughout the import process.
AOS instances must be stopped when the new model store is applied to the default schema. However, less time is required to stop an AOS instance than to import a model store.
When you import a model store, you can back up the existing model store to another schema. The schema that you back up the model store to cannot exist before you import the model store.
By default, if a conflict of element IDs occurs while an .axmodelstore file is imported, the import is stopped.
By default, optimization steps are performed if the number of elements in a model increases by more than 50 percent when a model or model store is reimported. For more information, see How to: Optimize a Model Store for Runtime.

Import a model store to the dbo schema (Windows PowerShell)

  1. Drain all client connections from the AOS instance that you are working with. For more information, see Drain users from an AOS.
  2. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.
    Import-AXModelStore -File <Filename> 
    
    This command imports a model store to the Microsoft Dynamics AX database and associates the model store with the default schema, dbo. You can also use the -BackupSchema parameter to copy the model store that is overwritten to a new schema. The schema that is specified by the -BackupSchema parameter cannot exist at the time that you run the cmdlet.
    For more information, see Import-AXModelStore.

Install a model store to the dbo schema (AXUtil)

  1. Drain all client connections from the AOS instance that you are working with. For more information, see Drain users from an AOS.
  2. On the Start menu, click Command prompt.
  3. Navigate to the directory for the management utilities. Typically, the location of this directory is %ProgramFiles%\Microsoft Dynamics AX\60\ManagementUtilities.
  4. At the command prompt, type the following command, and then press ENTER.
    axutil importstore /file:filename
    
    This command imports a model store to the Microsoft Dynamics AX database and associates the model store with the default schema, dbo. You can also use the /BackupSchema parameter to copy the model store that is overwritten to a new schema. The schema that is specified by the /BackupSchema parameter cannot exist at the time that you run AXUtil.

Import a model store to a temporary schema, and then apply the model store (Windows PowerShell)

  1. For this example, the non-default schema is named TemporarySchema.
    At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.
    Import-AXModelStore -File Staging.axmodelstore -SchemaName TemporarySchema
    
    This command installs the model store file in the schema that you specify.
    NoteNote
    The model store that you import to the non-default schema is not visible to Microsoft Dynamics AX.
  2. After the model store has been imported, drain all client connections from the AOS instance that you are working with. For more information, see Drain users from an AOS.
  3. After all AOS connections have been closed, type the following command, and then press ENTER.
    Import-AXModelStore -Apply:TemporarySchema
    
    This command applies a model store that was associated with the non-default schema, TemporarySchema, to the dbo schema. The model store then becomes visible to Microsoft Dynamics AX.
    For more information, see Import-AXModelStore.

Install a model store to a temporary schema, and then apply the model store (AXUtil)

  1. For this example, the non-default schema is named TemporarySchema.
    On the Start menu, click Command prompt.
  2. Navigate to the directory for the management utilities. Typically, the location of this directory is %ProgramFiles%\Microsoft Dynamics AX\60\ManagementUtilities.
  3. At the command prompt, type the following command, and then press ENTER.
    axutil importstore /file:filename /schemaname:name /verbose
    
    
    This command installs the model store file in the schema that you specify.
    NoteNote
    The model store that you import to the non-default schema is not visible to Microsoft Dynamics AX.
  4. Drain the client connections that are connected to the AOS instance that you are working with. For more information, see Drain users from an AOS.
  5. At the command prompt, type the following command, and then press ENTER.
    axutil importstore /apply /schemaname:TemporarySchema /verbose 
    
    This command applies a model store that was associated with the non-default schema, TemporarySchema, to the dbo schema. The model store then becomes visible to Microsoft Dynamics AX.

Tuesday, 7 April 2015

Field ‘Item number’ must be filled in. when release a product

Reason:
System don’t find any record in EcoResProductIdentifier table.
Solution: 
Use the excel-addin to fill the data in EcoResProductIdentifier table. Make sure to use the same Product number.

Wednesday, 1 April 2015

Cannot delete an unused main account in Dynamics AX 2012 R2

After creating a new financial dimension (about a week elapsed), a decision was made to delete the newly created financial dimension.
We knew these dimension values weren’t used on any posted or un-posted transactions, so the expectation was that we could simply delete these without any issues. So you can imagine the surprise when we tried to delete the dimension values only to receive the following error message:
A financial dimension value is based on the <dimension value> record and has been used on a transaction. You cannot delete the <dimension value> record.
                                    
This error is displayed by the system if records exist within the DimensionAttributeLevelValue table for the given Dimension Value.

So before I move on and explain how the issue was resolved, let me start off with a little caveat…
The description below isn’t a comprehensive breakdown that covers all possible scenarios that result in records being inserted into the DimensionAttributeLevelValue table, but it illustrates the use case scenario that caused the above-mentioned issue.

So when does the system create records in the DimensionAttributeLevelValue table?
One of the use cases that result in records being created in this table is when a user, as an example, creates a new general journal line and enters in the financial dimensions on that line.
At this stage the system creates (if it doesn’t already exists) an entry in the DimensionAttributeValueCombination for the financial dimension combination specified on the general journal line. The make-up of the specified financial dimension combination is then stored in the DimensionAttributeLevelValue table.
For Example:
If the financial dimension combination reads 0100-OU_1-OU_3566, (where 0100 represents the Main Account Id, OU_1 the Department Financial dimension, and OU_3566 represents the Cost Centre Financial dimension), the system will create 2 records in the DimensionAttributeLevelValue table, namely
  • One record will be for the Department Code OU_1
  • The second record will be for the Cost Centre OU_3566.


So knowing this, we were able to deduce that a Journal Line was created to test financial dimension structures and hierarchies. The Test journal line was deleted (not posted), but the action of entering in the journal line resulted in records being created in the above-mentioned tables.

To resolve this, and allow the Dimension Value to be deleted, the records created in the above-mentioned tables would need to be manually deleted.

I’m very interested to know if there is a tool that can be used to ‘clean-up’ any un-used Financial Dimension combinations i.e. financial dimension combinations that were created in the system, but that aren’t associated with any posted or un-posted transactions.
Does anyone know of a tool that does this? (Feel free to leave some comments)