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!!!