Wednesday, 29 October 2014

Ledger account alias | AX 2012

Purpose: the purpose of this article is to illustrate the Ledger account alias functionality which used to provide a shortcut to a complete or partial ledger account number.
Scenarios: assume that the accounts manager in Contoso designed the expense accounts structure to be associated with three dimensions (Department, Cost center and Expanse Purpose) . 
That's mean each time the clerk Intends to register a car rental expense he must specify the three dimension(Department, Cost center and Expanse Purpose).Therefore he decided to use the Ledger account alias functionality in order to simplify the entries process. to know how he can do that please do the following :    
  1. Click General ledger > Setup > Chart of accounts > Ledger account alias.
  2. Click New and enter a name for the ledger account alias.
  3. Select a type for the alias to specify who has access to the ledger account alias.
    Shared – The ledger account alias will be available for all legal entities.
    User group – The ledger account alias will be available for the user group that you select in the Group field.
    User – The ledger account alias will be available for the user group that you select in the User ID field.
  4. Select the account structure to use the ledger account alias in.
  5. Select the legal entity to use the financial dimensions from.
  6. Select the values that will be displayed when the ledger account alias is entered in a ledger account field.
  7. In the Initial focus field, select the financial dimension that will be selected when you enter this ledger account alias for a ledger account.
  8. Close the Form
  9. Go to General ledger > Journal General Journal
  10. Click New button > create new Journal Batch > Click Line Button

  11. Go to the Account Filed and enter a name for the ledger account alias in my case"CR"


  12. Press TAB Button and enjoy :) .  the system automatically convert the "CR" to main Account with Dimensions.

DIMF Part I:Export Customers to DAT File | Dynamics AX 2012

Purpose: The purpose of this article is to illustrate how to use Data import/export framework(DIXF) to export Customers Accounts to DAT File.

The DAT file used to transfer master data from Microsoft dynamics AX instance to another.
--

To Export the Customers Accounts please do the following steps :


  1. Go to Data import export framework ---> Source Data Format.
  2. Click New in the source name write "DAT" in the description write "DAT File" and from the Type drop-down list select "AX" then Close the Form.
  3. Go To Data import export framework ---> Processing Group.
  4. Click New ---->Write "CustDat" in the Group Name-->Write Description ---> Click the Entities Button.
  5. Select Customer from the Entity Field ---> Select DAT from Source data format (the source which was created in step 2)--> then click Close.
  6. Select "CustDAT" form the Processing Group ----> then Click the "Get Staging data" button to export the customer data from the original table to temporary table.
  7. Write proper description for the staging data job --> Then click "OK" button.
  8. Click "Run" button in the "Staging data execution" form.
  9. Click "OK" Button.
  10. The message inform you about the the record number that have been inserted in the staging Table --> then Click "Close" Button.
  11. Select "CustDAT" form the Processing Group ----> then Click the "Export To AX" button to export the customer data from the Staging table to the DAT file.
  12. write the file name with full path (Always use folder ) ----> then Click "OK" Button.
  13. when you check the path you will find that the export process was generated to files one .dat and the other one is .def

DIMF Part II: Filter data before exporting to DAT File | Dynamics AX 2012

Purpose: The purpose of this article is to illustrate how to use Data import/export framework(DIXF) to export specific data to DAT File.

In part I of this series we discussed how to export all customers records without applying any kind of filters. today we are going to discuss how we can add filters to export specific customers by using one of the Data import/export framework (DIXF) functionality,


Scenario: Exporting all customers records that have customer group 80.

Note : This article discuss specific functionality in DIXF (Applying Filters) so we are not going to explain the exporting process from A to Z. for more information about exporting data to DAT file step by step please see DIMF Part I:Export Customers to DAT File | Dynamics AX 2012 .

PrerequisitesCreate new "Group Processing" as we discussed in part 1 Don't use the same one that we created previously to export All customers.

please do the following steps:


  1.  Go to Data Import Export framework --> Processing Group
  2. Select  the new "Group processing" that you just created,  --> then Click "Entities" Button.
  3. Select Customers entities --> then click "Select" Button(Here the trick).
  4. select customer group in the field column --> then write 80 in the Criteria.-->Click Ok.
  5. Close the Entity Group form
  6. Select the Processing Group ----> then Click the "Get Staging data" button to export the customer data from the original table to temporary table.
  7. Write proper description for the staging data job --> Then click "OK" button
  8. Click "Run" button in the "Staging data execution" form
  9. Click "OK" Button
  10. The message inform you about the the record number that have been inserted in the staging Table --> then Click "Close" Button
  11. Select "CustDAT" form the Processing Group ----> then Click the "Export To AX" button to export the customer data from the Staging table to the DAT file.
  12. write the file name with full path (Always use folder ) ----> then Click "OK" Button
  13. Go to path where the exported file located. open the .DAT File using MS Excel, note that customers with customer group No. 80 was only exported.

Tuesday, 28 October 2014

http://blogs.msdn.com/b/axinthefield/archive/2012/03/29/dynamics-ax-2012-links-amp-info.aspx
http://it-ebooks.info/book/3531/

Monday, 27 October 2014


Finding the occurrence of string within another string through X++

29AUG
X++ offers a lot of string functions to be used on the strings. Here, we will be using the “strscan” function. The “strscan” searches for a string within another string
————————————————————————————————————-
The strscan function takes the following arguments
Strscan (str text, str characters, int position, int number);
Text: The target string
Characters: The string to be found
Position: The first position in the target string to perform the search
Number: Number of times search will be performed. Normally, it is the length of the original string. If a negative sign is used in this argument, the search operation is performed in the reverse order
————————————————————————————————————-
Below is the code to find any character in a string.
int position;
str targetstring = “ABCD”
position = strscan( targetstring, “CD”,3,strlen(targetstring);
if (position)
{
info(“Found”);
}
else
{
info(“Not Found”);
}

Creating a Customer Form at Run Time in X++

5SEP
The job “CustomerForm” creates a customer form at run time in x++. In the form, I have used two datasources “CustTable” and “DirPartyTable”. I have also shown how to add menuitemfunctions in a form through X++.
Here is the code in X++:
public static void CustomerForm(Args _args)
{
//Initialization
DictTable dictTable;
DictTable dictTable1;
Form form;
FormBuildDesign design;
FormBuildDataSource formBuildDataSource;
FormBuildDataSource formBuildDataSource1;
FormBuildActionPaneControl actionPane;
FormBuildActionPaneTabControl actionPaneTab;
FormBuildButtonGroupControl buttonGroup1;
FormBuildButtonGroupControl buttonGroup2;
FormBuildCommandButtonControl CommandNew;
FormBuildCommandButtonControl CommandDelete;
FormBuildMenuButtonControl CustomerButton;
FormBuildFunctionButtonControl NewCustomerButton;
FormBuildFunctionButtonControl ForecastButton;
FormBuildGroupControl Grp;
FormBuildGridControl grid;
FormBuildGroupControl grpBody;
Args args;
FormRun formRun;
#task
//Adding DataSources
dictTable1 = new DictTable(tableNum(CustTable));
dictTable = new DictTable(tableNum(DirPartyTable));
form = new Form();
form.name(“Customer Overview”);
formBuildDataSource = form.addDataSource(dictTable.name());
formBuildDataSource.table(dictTable.id());
formBuildDataSource1 = form.addDataSource(dictTable1.name());
formBuildDataSource1.table(dictTable1.id());
//Building Form Design
design = form.addDesign(‘Design’);
design.caption(“Overview”);
design.style(FormStyle::SimpleList);
design.titleDatasource(formBuildDataSource.id());
//Adding Action Pane and Buttons
actionPane = design.addControl(
FormControlType::ActionPane, ‘ActionPane’);
actionPane.style(ActionPaneStyle::Strip);
actionPaneTab = actionPane.addControl(FormControlType::ActionPaneTab, ‘ActionPaneTab’);
buttonGroup1 = actionPaneTab.addControl(FormControlType::ButtonGroup, ‘NewDeleteGroup’);
buttonGroup2 = actionPaneTab.addControl(FormControlType::ButtonGroup, ‘ButtonGroup’);
CommandNew = buttonGroup1.addControl(FormControlType::CommandButton, ‘NewButton’);
CommandNew.buttonDisplay(FormButtonDisplay::TextAndImageLeft);
CommandNew.normalImage(‘11045′);
CommandNew.imageLocation(SysImageLocation::EmbeddedResource);
CommandNew.primary(NoYes::Yes);
CommandNew.command(#taskNew);
CommandDelete = buttonGroup1.addControl(FormControlType::CommandButton, ‘NewButton’);
CommandDelete.text(“Delete”);
CommandDelete.buttonDisplay(FormButtonDisplay::TextAndImageLeft);
CommandDelete.normalImage(‘10121′);
CommandDelete.imageLocation(SysImageLocation::EmbeddedResource);
CommandDelete.saveRecord(NoYes::Yes);
CommandDelete.primary(NoYes::Yes);
CommandDelete.command(#taskDeleteRecord);
CustomerButton = buttonGroup2.addControl(FormControlType::MenuButton, ‘CustomerquickCreate’);
CustomerButton.helpText(“Create New Customer”);
CustomerButton.text(“Customer”);
NewCustomerButton = CustomerButton.addControl(FormControlType::MenuFunctionButton, ‘CustomerquickCreate’);
NewCustomerButton.text(‘New’);
NewCustomerButton.saveRecord(NoYes::No);
NewCustomerButton.dataSource(formBuildDataSource.id());
NewCustomerButton.menuItemName(menuitemDisplayStr(CustomerquickCreate));
ForecastButton = buttonGroup2.addControl(FormControlType::MenuFunctionButton, ‘SalesForecast’);
ForecastButton.text(‘Forecast’);
ForecastButton.saveRecord(NoYes::No);
ForecastButton.menuItemName(menuitemDisplayStr(ForecastSalesGroup));
//Body
grpBody = design.addControl(FormControlType::Group, ‘Body’);
grpBody.heightMode(FormHeight::ColumnHeight);
grpBody.columnspace(0);
grpBody.style(GroupStyle::BorderlessGridContainer);
grid = grpBody.addControl(FormControlType::Grid, “Grid”);
grid.dataSource(formBuildDataSource.name());
grid.widthMode(FormWidth::ColumnWidth);
grid.heightMode(FormHeight::ColumnHeight);
grid.addDataField(formBuildDataSource.id(), fieldNum(DirPartyTable,Name));
grid.addDataField(formBuildDataSource1.id(), fieldNum(CustTable,AccountNum));
grid.addDataField(formBuildDataSource.id(), fieldNum(DirPartyTable,LanguageId));
Grp = design.addControl(FormControlType::Group, ‘Group’);
ForecastButton = Grp.addControl(FormControlType::MenuFunctionButton, ‘SalesForecast’);
ForecastButton.text(‘Forecast’);
ForecastButton.menuItemName(menuitemDisplayStr(ForecastSalesGroup));
args = new Args();
args.object(form);
formRun = classFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.detach();
}

The SysOperation Framework Overview

16SEP
Previously, the Runbase framework was being used to add the functionality that required batch processing. The Runbase framework has been replaced by the SysOperation framework, formerly known as Business Operation Framework. The Sysoperation framework creates a user interface which can be integrated with the batch server for batch processing.
The SysOperation framework can be used to implement operations that can scale to multiple processors by batch processing. It can also be implemented to prompt the user for an input. The batch processing feature can be used to control the time and duration of the operations which require more processing time. The framework also has support for queries, routing tasks and pack and unpack for parameter serialization.
The SysOperation framework basically enhances the performance of operations by explicitly scheduling their execution. Through the framework, the operations can be executed on user interaction or by scheduling them through the batch server.
The framework is an implementation of the MVC design pattern. The structure of the framework is defined below:
Model:
• Members
• Pack/UnPack
• Data contract
View:
• Dialog
Controller:
• Process
• User Prompt
• Run


This post was a short introduction to the SysOperation Framework. I will be writing about the comparison of Runbase framework and SysOperation framework in my next post. Tune in again to the blog for more info regarding the SysOperation framework.

5 ways to import your Data in Microsoft Dynamics AX 2012

27AUG
A critical phase in any ERP implementation, including Dynamics AX 2012 is the migration of master data. User Acceptance testing is smooth when customer sees their own data and obviously, the system isn’t classified as “functional” unless data is successfully entered as per the desired designs.
For beginners and new entrants into ERP, the database model in Dynamics AX 2012 can seem to be very complex and may give a tough time to the integrators and developers, who are migrating data from old systems to Dynamics AX 2012.
When the developers or system integrators have to import data in Dynamics AX 2012, they must know how to classify data. Data can be classified into 4 types.
System Configuration Data: The data which is used to set up the environment of Microsoft Dynamics AX 2012
Parameter Data: The Specific Data for a module which is migrated from a staging environment to the production environment.
Master Data: The data which describes an entity, such as Vendor and Customer etc., including the parties, locations, products and activities referenced by the entity.
Transactional Data: The data which describes an entity that document business events and record their economic value.
Microsoft Dynamics offers a wide range of options for importing Data. Each of the type is efficient and optimum in its’ own way.  The 5 ways to import data in Microsoft Dynamics AX are mentioned and discussed in detail below:

Microsoft Dynamics AX Import:

Dynamics AX Import:
The primary mechanism for transferring Data between the different instances of Dynamics AX is the standard Import method. The utility is available in System Administration->Common->Data Export/Import->Import.
In order to use the functionality of this feature, Definition groups have to be created which include the tables involved in importing of Data. This utility cannot be used for migrating data from one ERP system to another or to import data into the older versions of Dynamics AX 2012.

Microsoft Excel Add-in for Microsoft Dynamics AX:

Another powerful option to import Data in Dynamics AX is the Excel Add-in. Data has to be organized in a specific pattern and some basic requirements are need to be met in order to import data successfully. Only the Excel documents which meet the below mentioned requirements can be used to create or update Data in AX tables.
  • Replacement Keys: Parent Data source must have unique indexes other than RecId.
  • Related Replacement Keys: Each RecId-based foreign key must be related to a table that specifies a replacement key
  • Relationship Direction: Relationships pointing towards parent from child element should be used only
  • Query and Service Consistency: Query and service must be synchronized in order to ensure consistency
  • View Support: Services using views must be properly implemented using the specified methods only

RapidStart Services:

RapidStart services are used to populate basic configuration data along with some master data. The services cannot be used to import transactional data. These services can, however, be used to manage data.

AIF:

AIF has the ability to exchange external data in the form of XML with Microsoft Dynamics AX. To call an AIF service, System administration > Setup >Services and Application Integration Framework > Inbound ports, and then click New. Enter a Port name and description. Select service operations under Service Operations. Click on Activate and use the system generated WSDL URI to import Data externally.

Microsoft Import Export Framework:

The Microsoft Import Export Framework is a very powerful tool for importing and exporting Data. It has predefined entities which map the data to the desired fields and validates the data. The data is at first migrated to a staging environment where it can be validated once again. After that, it is finally transferred to the AX tables and new records are created or existing records are updated. There are 5 main steps to import Data using the Framework:
  1. Prepare Data Source
  2. Select an AX entity
  3. Map and Validate Data
  4. Transfer to Staging Tables
  5. Transfer from Staging Tables to final AX destinations.
The framework also allows creating customized entities. I will be writing in detail much more about data migration scenarios in Dynamics AX 2012 so visit us frequently if this is something of your interest!