Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

How to: Invoke operations in AX Retail Point of Sale services

Sample files
Provide a link to any sample files here.

Further reading
Microsoft Dynamics AX 2012 for Developers [AX 2012] SDK Download RunOperation Method

Tutorial
AX Retail Point of Sale allows partners to customize services. Partners can programmatically invoke the same core operations users invoke by pressing a button in the UI. 1. Download and install the Dynamics AX 2012 for Retail SDK 2. Open the solution file e.g. C:\Users\<username>\My Documents\Retail POS Plugins\Services\Services.sln 3. Customize the Blank Operation service project by changing the code 4. Call the Application.RunOperation method and specify the PosisOperations.ItemComment operation and string argument. 5. Make a copy of the DLL being replaced in C:\Program Files\Microsoft Dynamics AX\6.0\Retail POS\Services so it can be restored later 6. Compile the project and copy the customized DLL to the POS Services folder, replacing the existing one e.g. C:\Program Files\Microsoft Dynamics AX\6.0\Retail POS\Services\BlankOperation.dll 7. Run pos.exe and log in 8. On the main screen, click Tasks then right click on a button and change the action to BlankOperation, set the Operation number field to a unique string e.g.

ItemCommentFromSeattle and the Blank operation Param to Hello from Seattle

Example
public void BlankOperation(IBlankOperationInfo operationInfo, IPosTransaction posTransaction) { if (operationInfo == null) throw new System.ArgumentNullException("operationInfo"); if (posTransaction == null) throw new System.ArgumentNullException("posTransaction"); switch (operationInfo.OperationId) { case "ItemCommentFromSeattle": // Add comment to currently selected item Application.RunOperation(PosisOperations.ItemComment, operationInfo.Parameter); break; default: break; } }

You might also like