Professional Documents
Culture Documents
How To Modify More Than One Service in An Assembly
How To Modify More Than One Service in An Assembly
Further reading
Microsoft Dynamics AX 2012 for Developers [AX 2012] SDK Download
Tutorial
Dynamics Retail AX Retail POS load services from assemblies at runtime. These assemblies should be placed under {AppPath}\Services folder. A service in POS is an assembly that implements one or more of any of the following interface: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. IApplicationService IBarcode IBlankOperations ICard ICashChanger ICCTV ICorporateCard ICreditMemo ICurrency ICustomer ICustomField IDialog IDimension IDiscount IEFT IEOD IGiftCard IInfoCodes IItem ILoyalty 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. IPeripherals IPharmacy IPrice IPrinting IPurchaseOrder IRFID IRounding ISalesInvoice ISalesOrder IStockCount IStoreInventoryServices ITax ITaxFree ITenderRestriction ICharges IInteraction ILogOn ITimeRegistration IEnumerable<IBlankOperations>
NOTE: Definition of above interfaces can be found in Microsoft.Dynamics.Retail.Pos.Contracts.dll assembly under POS application directory or in Contracts project under LSPOSNET solution if access to source code is available. Each of these interface implement IService interface.
POS loads these services at the time of initialization using Managed Extensibility Framework (MEF). MEF loads assemblies from configured path and searches them for the types are implemented in it and hooks its to its corresponding service property in POSApplication object. NOTE : To have more than one service in an assembly is as simple as adding implementation of more than one of the above interface in it. As shown in an example below ILoyalty and Ilogon services are implemented in two different projects and will yield two different assemblies. Lets create a single assembly for these two by following the below steps
Figure 3: Add Existing or Create new code files that implement the Service Interface.
Select the LogOn.cs file by browsing its physical path. Repeat the same steps for Loyalty.cs file.
Copy this DLL to move to services folder under POS Application directory.