Monday, August 26, 2013

Creating an AX 2012 eCommerce sales order

When creating an order in the SharePoint 2013 based eCommerce site for AX 2012 for Retail R2, there are a few things that need to occur for the AX sales order to actually get created. Additionally, there is another step needed for a customer to be able to pick up an order in the store.  Note: There are two types of delivery methods that can be assigned to an order: delivery and pickup.
 
When an order is created from the ecomm site the order IS NOT an AX sales order at that point in time. It is created locally on the online store's DB. The user is presented with an order confirmation number, not a sales order number.

To bring an online store order into AX to create a sales order, the user must do the following in order:
  1. Run the appropriate transaction job for P-job that links to that retail channel (P-0001_OC for contoso data)
  2. Run the 'Synchronize online orders' job from under Retail -> Periodic -> 'Synchronize online orders'

While I'm not sure why this approach was taken, I can take a few guesses as to why:
Pros to this approach in my opinion (IMO)
  1. To allow the website to be independently available if the headquarters (AX) is down
    1. This allows POS users to still be able to take orders via the web from the stores if the system is down
  2. Faster responses to order creation
  3. To allow the web front ends to scale
  4. To mitigate the risk of security vulnerabilities
Cons to this approach IMO
  1. The Retail Transaction Services 'createCustomerOrder' static method is not used like the POS currently does. 
    1. Be extra vigilant about where logic placed for orders now. There appears to be a disconnect in logic now with Omni-channel sales. The data part is correct but I'd like to see the logic part also covered.
  2. The order is not instantaneous.
    1. Think of booking a car while on the rental car bus and, upon arriving with a confirmation number, not having it show up in the system until a few back office jobs are run. I get that you can set it to run every 5 minutes but still...
  3. The user is presented with an order confirmation number, not a sales order number. With that in mind, customers will always reference this when referencing their order.
    1. The base sales order form doesn't have this field. You have to navigate to it via a join to the RetailTransactionTable record that has it. Kinda a pain to point a user to go to two different places...
    2. I believe you can reference this number in the POS to pull up the order though
Notes to my cons
  1. You can change the way the sales orders process works through a customization. 
    1. I'll need to tinker more with real scenarios to determine if I'll need to do this or this approach is good.
For pickups, an additional step of running the A/N job for pushing the customers to the appropriate online channel (A-1010_OC and N-1010_OC for contoso data) if the order was for a new customer. This way, the user will exist in the POS when the order is brought up.

Hopefully there will be good discussions going on around this post below. Still pretty new functionality...

6 comments:

  1. But I can view my sharepoint registered customer on AX 2012 R2. By running A-1010_OC and N-1010_OC jobs. But my problem is while "Synchronize online orders" job, it's not responding(AX 2012 R2 goes to the not responding state). I'm using share point 2013 & dynamics ax 2012 r2 on Hyper-V. I have i5 processor with 32GB RAM Memory. I allocated the 24GB RAM Memory for the Virtual machine.

    ReplyDelete
  2. You can see your customers in Sharepoint because in the EP portal, you're pulling actual data from AX. The eCommmerce store is actually a separate DB completely so you have to integrate customers between AX and the eCommerce site(s) to see them in eCommerce. The eCommerce site acts just like the POS retail stores. If AX goes down, your EP won't function but you WILL be able to still conduct transactions on the online website as its a separate DB like explained above.

    If I understand your issue, you are not able to sync orders as the system stops responding.

    This can really be a bunch of things and sometimes even more than one issue. Really hard to peg without actually being in the system. How much memory do you have on your C drive? Is your CPU being maxed out?

    You should also see if you can step into the code to see what is happening. I've seen this happen where someone coded an infinite loop and that's no fun. Or there is just so much data that it's taking forever? Also, check your event viewer and process monitors on the server.

    If the above methods don't point to something, check out http://technet.microsoft.com/en-us/library/jj149695.aspx to see the other tools like Trace Parser, Performance Monitor, SCOM, etc. From these, you should be able to get the info you need.

    ReplyDelete
  3. Hi Justin Carter,
    Thanks for your reply.
    But upto now the synchronize online order is not responding only, but I have some improvement on the process. Now i can see the order on the AX side (Retail-> Inquires-> Online store transcations). But i cannot see as a sales order. I went & debug the code. But there is not response. Do you have any other idea??? Can you help me....

    ReplyDelete
  4. There is an additional process to convert the Online Store Transactions to sales orders. It is the 'Synchronize online orders' process I detailed in step 2 above. This should, assuming the data is clean, create the actual AX sales orders from this Online store transactions form. The P-job just pulls them into that staging table.

    Sounds like you are almost there! Great to hear!

    ReplyDelete
  5. Hi Justin Carter,
    Thanks for your kind reply....
    I just found the answer for my problem. I just debug the code, after that I commented the line which struck. I face error on the code where(CREDITCARD class, recordAuthorization Method)Line: "info(strFmt("Credit card UniqueCardId : %1", creditCardAuthTrans.UniqueCardId));" , "creditCardAuthTrans.insert();" I commented these two lines. So I can able to get the sales order back to the AX.
    Thanks for your Guidance....

    ReplyDelete
  6. Good to hear!

    Are you still able to process credit cards from the online store and see the transactions in AX? The AuthTrans insert is pretty important as credit cards are the main form of payment from the website.

    If the tender setup is missing something for that retail channel, I can see it potentially doing something similar.

    ReplyDelete