Wednesday, June 20, 2012

Site Services & Commerce Services in AX 2012


Site Services

Organizations can use Sites Services for Microsoft Dynamics ERP to easily build web sites that extend their business processes to the Internet and integrate smoothly with Microsoft Dynamics AX, often with no need for IT support. Before you can use Sites Services, you need to sign up for an account. In many organizations, the IT department or a partner sets up, customizes, and maintains Sites Services.

Microsoft Dynamics AX includes four Sites Services solutions:
  • Online case request – Customer support representatives can accept feedback and questions for case management.
  • Human resources recruitment – Human resources staff can display ads for job openings online and receive applications from candidates.
  • Request for quotation – A purchasing agent can post purchasing needs online and vendors can review them and respond with quotations.
  • Unsolicited vendor registration – The purchasing department can accept unsolicited vendor registrations.
You can also create your own Internet-based solutions. Following are some examples:
  • Marketing - Create a marketing campaign that collects and tracks sales leads.
  • Customer service - Publish customer service information and collect customer feedback.
  • Product registration - Provide a convenient site for customers for product registration.

    For more information please click here.

Commerce Services

Organizations can use Commerce Services for Microsoft Dynamics ERP to sell products online easily through established marketplaces such as eBay and online stores that the organizations themselves create.
Catalogs and product listings are centrally managed, and sales orders flow seamlessly back into Microsoft Dynamics AX for processing.
Using Commerce Services provides the following benefits:
  • Sell through multiple channels by extending your sales presence to your own online store and online marketplaces, such as Amazon, eBay, and others.
  • Provide seamless inventory management between Microsoft Dynamics AX and the online store. Changes in stock levels are automatically reflected in the online store.
  • Provide seamless payments between Microsoft Dynamics AX and the online store. With Commerce Services payment processing is integrated between an organization’s online shopping cart and its back office software.
  • Provide seamless order management between Microsoft Dynamics AX and the online store: Commerce Services ties together online customer acquisition efforts with back-office order fulfillment.

For more information please click here.


Enjoy DAX!!!

Friday, June 15, 2012

HcmWorkerImportService to create/import worker into AX 2012

Hi All,
         Today we will be having a look at the AIFDocumentServices to create Worker (Contractor/Employee) into AX 2012 using HcmWorkerImportService.

Pre-requisites:
1) AX 2012 with CU2
2) Demo Data
3) Visual Studio Dev Tools

Scenario:
Wants to create/import worker into AX 2012 from an external application.

Solution:

  1. Create a Service Group in AOT
  2. Rename it to HcmWorkerImportDemo
  3. Drag the "HcmWorkerImportService" into your newly created service group.
  4. Right Click on the "HcmWorkerImportDemo" & click on Deploy Service Group.
  5. Go to System Administration -> Setup -> Services & Application Integration Framework -> Inbound Ports
  6. Find your "HcmWorkerImportDemo" Inbound port & Copy the WSDL Address.
  7. Create a C# Console Application.
  8. Right click on your solution -> add Service Reference -> Paste the WSDL Address
  9. Type the Reference Name like "ABC"
  10. Include ABC as a namespace.
  11. Modify the main() method with the below code :
            HcmWorkerImportServiceClient proxy = new HcmWorkerImportServiceClient();
            CallContext context = new CallContext();
            context.Company = "ceu"; //Company Name

            AxdHcmWorkerImport worker = new AxdHcmWorkerImport();
            AxdEntity_HcmWorker hcmWorkerTable = new AxdEntity_HcmWorker();

            AxdEntity_DirPerson_DirPerson party = new AxdEntity_DirPerson_DirPerson();
            party.NameAlias = "Kuldeep";
            party.Gender = AxdEnum_Gender.Male;
            party.MaritalStatus = AxdEnum_DirPersonMaritalStatus.Married;

            AxdEntity_DirPersonName personName = new AxdEntity_DirPersonName();
            personName.FirstName = "Kuldeep";
            personName.MiddleName = "Singh ";
            personName.LastName = "Godara";
            party.DirPersonName = personName;

            hcmWorkerTable.DirPerson = party;

            AxdEntity_HcmEmployment personEmployment = new AxdEntity_HcmEmployment();
            personEmployment.EmploymentType = AxdEnum_HcmEmploymentType.Contractor;
            personEmployment.LegalEntity = "ceu"; //Company Name

            hcmWorkerTable.HcmEmployment = new AxdEntity_HcmEmployment[1] { personEmployment };

            worker.HcmWorker = new AxdEntity_HcmWorker[1] { hcmWorkerTable };

            try
            {
                proxy.create(context, worker);
                Console.WriteLine("Success");
                Console.ReadLine();
            }
            catch
            {
                throw;
            }
12. Run the Application.
13. Cross Check your worker into AX 2012.


Enjoy DAX !!!

Monday, June 11, 2012

Calculate Time Consumption in AX 2012


Hi All,
          There is a very useful function timeConsumed() in Global class which we can use to calculate the time taken to execute business logic in AX 2012.
This function will return time consumed string in the form of XX hours XX minutes XX seconds (00:00:00). It handles up to a 24 hour time difference not dependent on start/end time. 

Limitation: If time consumed is greater then 24 hours will only report time over 24 hour intervals.
Code: 
static void DemoTimeConsumed(Args _args)
{
    FromTime startTime = timeNow();
    int i;
    str res;
    ;
   
    for (i = 1 ; i <= 2650000; i++)
    {
        res+= int2str(i);     
    }
       
    info(strFmt("Total time consumed with this operation is  %1", timeConsumed(startTime, timeNow())));
}

Enjoy DAX!!!

Monday, June 4, 2012

AX 2012 AIF Calling via WCF

Hi,
     Today we will look at "How to call a AX2012 Service into a WCF App.
The CustCustomerService (External name CustomerService) can be used to create a customer in Ax through AIF. When using the http adapter and consuming this service in a .Net Application, this is a tried and tested way to do it. Notice the DirPartyTable assignment in the code. You do not need to specify the DirParty member, but that is where the customer name is held in Ax 2012


static void WebServiceTest()
{
    using (Ax2012WebService.CustomerServiceClient custClient = new Ax2012WebService.CustomerServiceClient())
    {
        var context = new Ax2012WebService.CallContext() { Company = "ceu" };
        var customers = new Ax2012WebService.AxdCustomer
            {
                CustTable = new Ax2012WebService.AxdEntity_CustTable[] 
                    { 
                        new Ax2012WebService.AxdEntity_CustTable() 
                        { 
                            CustGroup="10", 
                            TaxGroup="CA", 
                            DirParty = new Ax2012WebService.AxdEntity_DirParty_DirPartyTable[1] 
                            {
                                new Ax2012WebService.AxdEntity_DirParty_DirOrganization() 
                                    { LanguageId = "en-us", Name = "SS 001" }
                            }
                        }
                    }
            };
        custClient.create(
            context,
            customers
            );
    }
}


Enjoy DAX!!!

Wednesday, April 25, 2012

Convert/Upgrade MorphX Report to SSRS in Dynamics AX


One of the major change in Dynamics AX 2012 is related to reporting services. Though we were able to develop some SSRS reports in AX 2009 as well with limitted framework functionality. However, in AX 2012 SSRS reporting framework is much more enhanced. Currently, you can import your AX traditional reports of MorphX in 2012 with no change. However, you cannot develop new MorphX reports in 2012. So this is the right time to move all your MorphX reports to SSRS as in future releases of AX MorphX framework will be completey removed.

In order to migrate AX reports to SSRS report following are some important points
        1.       Create a new query and make exactly the same query used in X++ report.
        2.       Move all your business logic to RDP (Report data provider) class.
        3.       AutoDesign reports of X++ will be replaced by AutoDesign in SSRS reports.
        4.       Generated Design on X++ report will be replaced by PrecisionDesign in SSRS reports.

         Please have a look on the guidance to upgrade report here.

           Enjoy DAX !!!

Tuesday, April 24, 2012

Bar Code Setup in AX 2009

Hi,
   In this post we will be discussing about How to setup barcodes in AX 2009 as many companies use barcodes for different purposes like:
Tagging Items – To identify items
Tagging pallets – To identify pallets
Tagging locations – To identify locations

Microsoft Dynamics Axapta 2009 supports use of bar codes which can be setup using very simple steps. This article contains two main setups:
STEP 1: The first step is to set up the bar code to be used using AX Barcode setup form.
STEP 2: The second step is to associate the bar code with the item

STEP 1: Set up the bar code to be used using AX Barcode setup form.
1. From Dynamics AX client navigate to:
Basic > Setup > Bar code setup
2. On the overview tab, Click New and enter details:









3. In the General Tab enter Minimum and Maximum length.














Bar code setup
Type the name of the bar code.
Description
Enter a description of the bar code.
Bar code type
Select the bar code type from the list.











Font
Select a font for the bar code from the list of available fonts installed in Microsoft Windows.
Size
Specify the font size of the bar code.
Minimum length
Specify the minimum length allowed for the bar code.
Maximum length
Specify the maximum length allowed for the bar code.

STEP 2: Associate the bar code with the item
1. From Dynamics AX 2009 Client navigate to:
Inventory management > Items > Setup button > Bar codes

Use this form to set up multiple bar codes for each item, in addition to setting up bar codes according to item configurations and dimensions. Bar codes identify items and register inventory information.
For example, you can set up bar codes for each color of an item, and then for every sale you register the item and the item color. In this way, you know the number of items on stock by color.

Tabs
Overview tab
Get an overview of the bar codes that are associated with an item. You can also create, modify, or delete the bar codes.
General tab
View specific information about an item and the bar code that is associated with it. The information is grouped into four areas, such as information about the Item, Bar code, Setup, and Item dimension. On the General tab, you can also create, delete, or modify a bar code.
Fields
Item number
This is a unique user-defined code that is assigned when items are created. It is recommended that special characters or spaces not be used in the item number.
Item numbers can be generated by the system by linking the item number to a Number sequences (form).
Configuration
Select an item configuration to specify an item with specific attributes.
Size
Specifies the size of the item.
Color
Specifies the color of the item.
Bar code setup
Select the bar code type that you would like to apply to the item.
Scanning
Used for scanning items with us.
To be printed
Used when printing.
Bar code
Bar code digits.
Dimension No.
Identification of dimensions for the item.
Quantity
Quantity in the inventory units of the item.
Description
Brief description of the transaction.
Warehouse
Enter the warehouse in which you store your items.
Batch number
Enter the batch number dimension. If you select Edit lines and Explode lines in the upper section of the Shipment /Receive form, you can edit the batch number for the transfer order line.
Location
Location inside a warehouse. If you select Edit lines and Explode lines in the upper section of the Shipment /Receive form, you can edit the location number for the transfer order line.
Pallet ID
Unique ID for the pallet (Serial Shipping Container Code).
Serial number
Serial number dimension. If you select Edit lines and Explode lines in the upper section of the Shipment/Receive form, you can edit the serial number for the transfer order line.
Inventory Button
Click Inventory > Dimensions display to select the inventory dimensions to appear in the Item - bar code form.

Enjoy DAX !!!

Wednesday, April 4, 2012

Discard USR Layer Changes in AX 2012

With the advent of model management in Dynamics AX 2012, Microsoft has gotten rid of the ax.aod files which in previous versions of DAX constituted the layers.
In DAX 2012 adjustments for the meta data model and code are stored in the modelstore in the database.

In previous version deleting a layer containing adjustments to the standard application consisted of delete the ax.aod file and synchronizing and compiling.

How is this done in DAX 2012 ?

The answer is a command-line tool called AxUtil.

To delete e.g. the usr-layer in the application do the following:

1) Shut down all AOS-servers but one (applicable only if you have more than one AOS running).
2) Go to command line interface on the server where the last AOS is running.
3) Go to the folder where DAX's management utilities are placed, e.g.
C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities
4) Run the Axutil like this:
Axutil delete /layer: /db:


To delete the usr-layer in the MicrosoftDynamicsAx database:
Axutil delete /layer:usr /db:MicrosoftDynamicsAxBelow an example is shown:
















5) Restart the AOS
6) Start the DAX client.
7) In the process of starting up, DAX will detect that something has happened with the modelstore, and prompt you with:





























Choose the action appropriate for your situation.
8) Start the remaining AOSes.

Enjoy DAX!!!